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

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


    super(pactContract);

    int[] k1 = pactContract.getKeyColumns(0);
    int[] k2 = pactContract.getKeyColumns(1);
   
    this.keys1 = k1 == null || k1.length == 0 ? null : new FieldList(k1);
    this.keys2 = k2 == null || k2.length == 0 ? null : new FieldList(k2);
   
    if (this.keys1 != null) {
      if (this.keys2 != null) {
        if (this.keys1.size() != this.keys2.size()) {
          throw new CompilerException("Unequal number of key fields on the two inputs.");
View Full Code Here


   */
  public LocalProperties filterByNodesConstantSet(OptimizerNode node, int input)
  {
    // check, whether the local order is preserved
    Ordering no = this.ordering;
    FieldList ngf = this.groupedFields;
    Set<FieldSet> nuf = this.uniqueFields;
   
    if (this.ordering != null) {
      final FieldList involvedIndexes = this.ordering.getInvolvedIndexes();
      for (int i = 0; i < involvedIndexes.size(); i++) {
        if (!node.isFieldConstant(input, involvedIndexes.get(i))) {
          if (i == 0) {
            no = null;
            ngf = null;
          } else {
            no = this.ordering.createNewOrderingUpToIndex(i);
View Full Code Here

   *
   * @return True, if the resulting properties are non trivial.
   */
  public RequestedLocalProperties filterByNodesConstantSet(OptimizerNode node, int input) {
    if (this.ordering != null) {
      final FieldList involvedIndexes = this.ordering.getInvolvedIndexes();
      for (int i = 0; i < involvedIndexes.size(); i++) {
        if (!node.isFieldConstant(input, involvedIndexes.get(i))) {
          return null;
        }
      }
    } else if (this.groupedFields != null) {
      // check, whether the local key grouping is preserved
View Full Code Here

   
    final int[] ssKeys = iteration.getSolutionSetKeyFields();
    if (ssKeys == null || ssKeys.length == 0) {
      throw new CompilerException("Invalid WorksetIteration: No key fields defined for the solution set.");
    }
    this.solutionSetKeyFields = new FieldList(ssKeys);
    this.partitionedProperties = new GlobalProperties();
    this.partitionedProperties.setHashPartitioned(this.solutionSetKeyFields);
   
    int weight = iteration.getMaximumNumberOfIterations() > 0 ?
      iteration.getMaximumNumberOfIterations() : DEFAULT_COST_WEIGHT;
View Full Code Here

    if (set instanceof FieldList) {
      return (FieldList) set;
    } else {
      final int[] cols = set.toArray();
      Arrays.sort(cols);
      return new FieldList(cols);
    }
  }
View Full Code Here

      Assert.assertEquals(ShipStrategyType.PARTITION_HASH, reducer.getInput().getShipStrategy());
      Assert.assertEquals(ShipStrategyType.FORWARD, sink.getInput().getShipStrategy());
     
      Channel c = reducer.getInput();
      Assert.assertEquals(LocalStrategy.COMBININGSORT, c.getLocalStrategy());
      FieldList l = new FieldList(0);
      Assert.assertEquals(l, c.getShipStrategyKeys());
      Assert.assertEquals(l, c.getLocalStrategyKeys());
      Assert.assertTrue(Arrays.equals(c.getLocalStrategySortOrder(), reducer.getSortOrders()));
     
      // check the combiner
View Full Code Here

      Assert.assertEquals(ShipStrategyType.PARTITION_RANGE, reducer.getInput().getShipStrategy());
      Assert.assertEquals(ShipStrategyType.FORWARD, sink.getInput().getShipStrategy());
     
      Channel c = reducer.getInput();
      Assert.assertEquals(LocalStrategy.COMBININGSORT, c.getLocalStrategy());
      FieldList l = new FieldList(0);
      Assert.assertEquals(l, c.getShipStrategyKeys());
      Assert.assertEquals(l, c.getLocalStrategyKeys());
     
      // check that the sort orders are descending
      Assert.assertFalse(c.getShipStrategySortOrder()[0]);
View Full Code Here

      // check that both reduce and combiner have the same strategy
      assertEquals(DriverStrategy.SORTED_REDUCE, reduceNode.getDriverStrategy());
      assertEquals(DriverStrategy.SORTED_PARTIAL_REDUCE, combineNode.getDriverStrategy());
     
      // check the keys
      assertEquals(new FieldList(1), reduceNode.getKeys());
      assertEquals(new FieldList(1), combineNode.getKeys());
      assertEquals(new FieldList(1), reduceNode.getInput().getLocalStrategyKeys());
     
      // check DOP
      assertEquals(6, sourceNode.getDegreeOfParallelism());
      assertEquals(6, combineNode.getDegreeOfParallelism());
      assertEquals(8, reduceNode.getDegreeOfParallelism());
View Full Code Here

      // check that both reduce and combiner have the same strategy
      assertEquals(DriverStrategy.SORTED_REDUCE, reduceNode.getDriverStrategy());
      assertEquals(DriverStrategy.SORTED_PARTIAL_REDUCE, combineNode.getDriverStrategy());
     
      // check the keys
      assertEquals(new FieldList(0), reduceNode.getKeys());
      assertEquals(new FieldList(0), combineNode.getKeys());
      assertEquals(new FieldList(0), reduceNode.getInput().getLocalStrategyKeys());
     
      // check DOP
      assertEquals(6, sourceNode.getDegreeOfParallelism());
      assertEquals(6, keyExtractor.getDegreeOfParallelism());
      assertEquals(6, combineNode.getDegreeOfParallelism());
View Full Code Here

     
      // check that both reduce and combiner have the same strategy
      assertEquals(DriverStrategy.SORTED_GROUP_REDUCE, reduceNode.getDriverStrategy());
     
      // check the keys
      assertEquals(new FieldList(1), reduceNode.getKeys());
      assertEquals(new FieldList(1), reduceNode.getInput().getLocalStrategyKeys());
     
      // check DOP
      assertEquals(6, sourceNode.getDegreeOfParallelism());
      assertEquals(8, reduceNode.getDegreeOfParallelism());
      assertEquals(8, sinkNode.getDegreeOfParallelism());
View Full Code Here

TOP

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

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.