Package eu.stratosphere.api.common.operators.util

Examples of eu.stratosphere.api.common.operators.util.FieldSet


      return;
    }

    for (String str : rf) {
      if (str != null) {
        FieldSet fs = readFieldSetFromString(str, inType, outType);
        dm.addReadFields2(fs);
      }
    }
  }
View Full Code Here


      return;
    }

    for (String str : cfe) {
      if (str != null) {
        FieldSet fs = readFieldSetFromString(str, inType, outType);

        for (int i = 0; i < outType.getArity(); i++) {
          if (!fs.contains(i)) {
            sm.addForwardedField(i, i);
          }
        }
      }
    }
View Full Code Here

    if (!matcher.matches()) {
      throw new InvalidProgramException("Unrecognized annotation string format.");
    }

    matcher = PATTERN_DIGIT.matcher(s);
    FieldSet fs = new FieldSet();

    while (matcher.find()) {
      int field = Integer.valueOf(matcher.group());
      if (!isValidField(outType, field) || !isValidField(inType, field)) {
        throw new IndexOutOfBoundsException("Annotation: Field " + field + " not available in the output tuple.");
      }
      fs.add(field);
    }
    return fs;
  }
View Full Code Here

      return;
    }

    for (String str : rf) {
      if (str != null) {
        FieldSet fs = readFieldSetFromString(str, inType, outType);
        sm.addReadFields(fs);
      }
    }
  }
View Full Code Here

      throw new RuntimeException("Either ConstantFields or ConstantFieldsExcept can be specified, not both.");
    }
   
    // extract notConstantSet from annotation
    if (notConstantSet != null) {
      FieldSet nonConstant = new FieldSet(notConstantSet.value());
      return new ImplicitlyForwardingSingleInputSemanticProperties(nonConstant);
    }
   
    // extract notConstantSet from annotation
    if (allConstants != null) {
      FieldSet nonConstant = new FieldSet();
      return new ImplicitlyForwardingSingleInputSemanticProperties(nonConstant);
    }
   
    SingleInputSemanticProperties semanticProperties = new SingleInputSemanticProperties();
   
View Full Code Here

    }
   
   
    // extract readSets from annotations
    if(notConstantSet1Annotation != null) {
      semanticProperties.setImplicitlyForwardingFirstExcept(new FieldSet(notConstantSet1Annotation.value()));
    }
   
    if(notConstantSet2Annotation != null) {
      semanticProperties.setImplicitlyForwardingSecondExcept(new FieldSet(notConstantSet2Annotation.value()));
    }
   
    // extract readSets from annotations
    if (constantSet1Annotation != null) {
      for(int value: constantSet1Annotation.value()) {
View Full Code Here

    @Override
    public FieldSet getForwardedField(int sourceField) {
      if (this.nonForwardedFields.contains(sourceField)) {
        return null;
      } else {
        return new FieldSet(sourceField);
      }
    }
View Full Code Here

      }
      else {
        if (this.nonForwardedFields1.contains(sourceField)) {
          return null;
        } else {
          return new FieldSet(sourceField);
        }
      }
    }
View Full Code Here

      }
      else {
        if (this.nonForwardedFields2.contains(sourceField)) {
          return null;
        } else {
          return new FieldSet(sourceField);
        }
      }
    }
View Full Code Here

      GenericDataSinkBase<?> sink = plan.getDataSinks().iterator().next();
      MapOperatorBase<?, ?, ?> mapper = (MapOperatorBase<?, ?, ?>) sink.getInput();
     
      SingleInputSemanticProperties semantics = mapper.getSemanticProperties();
     
      FieldSet fw1 = semantics.getForwardedField(0);
      FieldSet fw2 = semantics.getForwardedField(1);
      FieldSet fw3 = semantics.getForwardedField(2);
     
      assertNotNull(fw1);
      assertNotNull(fw2);
      assertNotNull(fw3);
     
      assertTrue(fw1.contains(0));
      assertTrue(fw2.contains(1));
      assertTrue(fw3.contains(2));
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
      e.printStackTrace();
      fail("Exception in test: " + e.getMessage());
View Full Code Here

TOP

Related Classes of eu.stratosphere.api.common.operators.util.FieldSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.