Package eu.stratosphere.compiler.plan

Examples of eu.stratosphere.compiler.plan.SinkPlanNode


    }
   
    // distinguish the node types
    if (node instanceof SinkPlanNode) {
      // descend to the input channel
      SinkPlanNode sn = (SinkPlanNode) node;
      Channel inchannel = sn.getInput();
      traverseChannel(inchannel);
    }
    else if (node instanceof SourcePlanNode) {
      TypeInformation<?> typeInfo = getTypeInfoFromSource((SourcePlanNode) node);
      ((SourcePlanNode) node).setSerializer(createSerializer(typeInfo));
    }
    else if (node instanceof BulkIterationPlanNode) {
      BulkIterationPlanNode iterationNode = (BulkIterationPlanNode) node;

      if (iterationNode.getRootOfStepFunction() instanceof NAryUnionPlanNode) {
        throw new CompilerException("Optimizer cannot compile an iteration step function where next partial solution is created by a Union node.");
      }
     
      // traverse the termination criterion for the first time. create schema only, no utilities. Needed in case of intermediate termination criterion
      if (iterationNode.getRootOfTerminationCriterion() != null) {
        SingleInputPlanNode addMapper = (SingleInputPlanNode) iterationNode.getRootOfTerminationCriterion();
        traverseChannel(addMapper.getInput());
      }

      BulkIterationBase<?> operator = (BulkIterationBase<?>) iterationNode.getPactContract();

      // set the serializer
      iterationNode.setSerializerForIterationChannel(createSerializer(operator.getOperatorInfo().getOutputType()));

      // done, we can now propagate our info down
      traverseChannel(iterationNode.getInput());
      traverse(iterationNode.getRootOfStepFunction());
    }
    else if (node instanceof WorksetIterationPlanNode) {
      WorksetIterationPlanNode iterationNode = (WorksetIterationPlanNode) node;
     
      if (iterationNode.getNextWorkSetPlanNode() instanceof NAryUnionPlanNode) {
        throw new CompilerException("Optimizer cannot compile a workset iteration step function where the next workset is produced by a Union node.");
      }
      if (iterationNode.getSolutionSetDeltaPlanNode() instanceof NAryUnionPlanNode) {
        throw new CompilerException("Optimizer cannot compile a workset iteration step function where the solution set delta is produced by a Union node.");
      }
     
      DeltaIterationBase<?, ?> operator = (DeltaIterationBase<?, ?>) iterationNode.getPactContract();
     
      // set the serializers and comparators for the workset iteration
      iterationNode.setSolutionSetSerializer(createSerializer(operator.getOperatorInfo().getFirstInputType()));
      iterationNode.setWorksetSerializer(createSerializer(operator.getOperatorInfo().getSecondInputType()));
      iterationNode.setSolutionSetComparator(createComparator(operator.getOperatorInfo().getFirstInputType(),
          iterationNode.getSolutionSetKeyFields(), getSortOrders(iterationNode.getSolutionSetKeyFields(), null)));
     
      // traverse the inputs
      traverseChannel(iterationNode.getInput1());
      traverseChannel(iterationNode.getInput2());
     
      // traverse the step function
      traverse(iterationNode.getSolutionSetDeltaPlanNode());
      traverse(iterationNode.getNextWorkSetPlanNode());
    }
    else if (node instanceof SingleInputPlanNode) {
      SingleInputPlanNode sn = (SingleInputPlanNode) node;
     
      if (!(sn.getOptimizerNode().getPactContract() instanceof SingleInputOperator)) {
       
        // Special case for delta iterations
        if(sn.getOptimizerNode().getPactContract() instanceof NoOpUnaryUdfOp) {
          traverseChannel(sn.getInput());
          return;
        } else {
          throw new RuntimeException("Wrong operator type found in post pass.");
        }
      }
     
      SingleInputOperator<?, ?, ?> singleInputOperator = (SingleInputOperator<?, ?, ?>) sn.getOptimizerNode().getPactContract();
     
      // parameterize the node's driver strategy
      if (sn.getDriverStrategy().requiresComparator()) {
        sn.setComparator(createComparator(singleInputOperator.getOperatorInfo().getInputType(), sn.getKeys(),
          getSortOrders(sn.getKeys(), sn.getSortOrders())));
      }
     
      // done, we can now propagate our info down
      traverseChannel(sn.getInput());
     
      // don't forget the broadcast inputs
      for (Channel c: sn.getBroadcastInputs()) {
        traverseChannel(c);
      }
    }
    else if (node instanceof DualInputPlanNode) {
      DualInputPlanNode dn = (DualInputPlanNode) node;
View Full Code Here


          }
         
          // no need to check whether the created properties meet what we need in case
          // of ordering or global ordering, because the only interesting properties we have
          // are what we require
          outputPlans.add(new SinkPlanNode(this, "DataSink("+this.getPactContract().getName()+")" ,c));
        }
      }
    }
   
    // cost and prune the plans
View Full Code Here

 
  @SuppressWarnings("unchecked")
  protected void traverse(PlanNode node, T parentSchema, boolean createUtilities) {
    // distinguish the node types
    if (node instanceof SinkPlanNode) {
      SinkPlanNode sn = (SinkPlanNode) node;
      Channel inchannel = sn.getInput();
     
      T schema = createEmptySchema();
      sn.postPassHelper = schema;
     
      // add the sinks information to the schema
      try {
        getSinkSchema(sn, schema);
      }
      catch (ConflictingFieldTypeInfoException e) {
        throw new CompilerPostPassException("Conflicting type infomation for the data sink '" +
            sn.getSinkNode().getPactContract().getName() + "'.");
      }
     
      // descend to the input channel
      try {
        propagateToChannel(schema, inchannel, createUtilities);
      }
      catch (MissingFieldTypeInfoException ex) {
        throw new CompilerPostPassException("Missing type infomation for the channel that inputs to the data sink '" +
            sn.getSinkNode().getPactContract().getName() + "'.");
      }
    }
    else if (node instanceof SourcePlanNode) {
      if (createUtilities) {
        ((SourcePlanNode) node).setSerializer(createSerializer(parentSchema, node));
        // nothing else to be done here. the source has no input and no strategy itself
      }
    }
    else if (node instanceof BulkIterationPlanNode) {
      BulkIterationPlanNode iterationNode = (BulkIterationPlanNode) node;
     
      // get the nodes current schema
      T schema;
      if (iterationNode.postPassHelper == null) {
        schema = createEmptySchema();
        iterationNode.postPassHelper = schema;
      } else {
        schema = (T) iterationNode.postPassHelper;
      }
      schema.increaseNumConnectionsThatContributed();
     
      // add the parent schema to the schema
      if (propagateParentSchemaDown) {
        addSchemaToSchema(parentSchema, schema, iterationNode.getPactContract().getName());
      }
     
      // check whether all outgoing channels have not yet contributed. come back later if not.
      if (schema.getNumConnectionsThatContributed() < iterationNode.getOutgoingChannels().size()) {
        return;
      }
     
      if (iterationNode.getRootOfStepFunction() instanceof NAryUnionPlanNode) {
        throw new CompilerException("Optimizer cannot compile an iteration step function where next partial solution is created by a Union node.");
      }
     
      // traverse the termination criterion for the first time. create schema only, no utilities. Needed in case of intermediate termination criterion
      if (iterationNode.getRootOfTerminationCriterion() != null) {
        SingleInputPlanNode addMapper = (SingleInputPlanNode) iterationNode.getRootOfTerminationCriterion();
        traverse(addMapper.getInput().getSource(), createEmptySchema(), false);
        try {
          addMapper.getInput().setSerializer(createSerializer(createEmptySchema()));
        } catch (MissingFieldTypeInfoException e) {
          throw new RuntimeException(e);
        }
      }
     
      // traverse the step function for the first time. create schema only, no utilities
      traverse(iterationNode.getRootOfStepFunction(), schema, false);
     
      T pss = (T) iterationNode.getPartialSolutionPlanNode().postPassHelper;
      if (pss == null) {
        throw new CompilerException("Error in Optimizer Post Pass: Partial solution schema is null after first traversal of the step function.");
      }
     
      // traverse the step function for the second time, taking the schema of the partial solution
      traverse(iterationNode.getRootOfStepFunction(), pss, createUtilities);
     
      if (iterationNode.getRootOfTerminationCriterion() != null) {
        SingleInputPlanNode addMapper = (SingleInputPlanNode) iterationNode.getRootOfTerminationCriterion();
        traverse(addMapper.getInput().getSource(), createEmptySchema(), createUtilities);
        try {
          addMapper.getInput().setSerializer(createSerializer(createEmptySchema()));
        } catch (MissingFieldTypeInfoException e) {
          throw new RuntimeException(e);
        }
      }
     
      // take the schema from the partial solution node and add its fields to the iteration result schema.
      // input and output schema need to be identical, so this is essentially a sanity check
      addSchemaToSchema(pss, schema, iterationNode.getPactContract().getName());
     
      // set the serializer
      if (createUtilities) {
        iterationNode.setSerializerForIterationChannel(createSerializer(pss, iterationNode.getPartialSolutionPlanNode()));
      }
     
      // done, we can now propagate our info down
      try {
        propagateToChannel(schema, iterationNode.getInput(), createUtilities);
      } catch (MissingFieldTypeInfoException e) {
        throw new CompilerPostPassException("Could not set up runtime strategy for input channel to node '"
          + iterationNode.getPactContract().getName() + "'. Missing type information for key field " +
          e.getFieldNumber());
      }
    }
    else if (node instanceof WorksetIterationPlanNode) {
      WorksetIterationPlanNode iterationNode = (WorksetIterationPlanNode) node;
     
      // get the nodes current schema
      T schema;
      if (iterationNode.postPassHelper == null) {
        schema = createEmptySchema();
        iterationNode.postPassHelper = schema;
      } else {
        schema = (T) iterationNode.postPassHelper;
      }
      schema.increaseNumConnectionsThatContributed();
     
      // add the parent schema to the schema (which refers to the solution set schema)
      if (propagateParentSchemaDown) {
        addSchemaToSchema(parentSchema, schema, iterationNode.getPactContract().getName());
      }
     
      // check whether all outgoing channels have not yet contributed. come back later if not.
      if (schema.getNumConnectionsThatContributed() < iterationNode.getOutgoingChannels().size()) {
        return;
      }
      if (iterationNode.getNextWorkSetPlanNode() instanceof NAryUnionPlanNode) {
        throw new CompilerException("Optimizer cannot compile a workset iteration step function where the next workset is produced by a Union node.");
      }
      if (iterationNode.getSolutionSetDeltaPlanNode() instanceof NAryUnionPlanNode) {
        throw new CompilerException("Optimizer cannot compile a workset iteration step function where the solution set delta is produced by a Union node.");
      }
     
      // traverse the step function
      // pass an empty schema to the next workset and the parent schema to the solution set delta
      // these first traversals are schema only
      traverse(iterationNode.getNextWorkSetPlanNode(), createEmptySchema(), false);
      traverse(iterationNode.getSolutionSetDeltaPlanNode(), schema, false);
     
      T wss = (T) iterationNode.getWorksetPlanNode().postPassHelper;
      T sss = (T) iterationNode.getSolutionSetPlanNode().postPassHelper;
     
      if (wss == null) {
        throw new CompilerException("Error in Optimizer Post Pass: Workset schema is null after first traversal of the step function.");
      }
      if (sss == null) {
        throw new CompilerException("Error in Optimizer Post Pass: Solution set schema is null after first traversal of the step function.");
      }
     
      // make the second pass and instantiate the utilities
      traverse(iterationNode.getNextWorkSetPlanNode(), wss, createUtilities);
      traverse(iterationNode.getSolutionSetDeltaPlanNode(), sss, createUtilities);
     
      // add the types from the solution set schema to the iteration's own schema. since
      // the solution set input and the result must have the same schema, this acts as a sanity check.
      try {
        for (Map.Entry<Integer, X> entry : sss) {
          Integer pos = entry.getKey();
          schema.addType(pos, entry.getValue());
        }
      } catch (ConflictingFieldTypeInfoException e) {
        throw new CompilerPostPassException("Conflicting type information for field " + e.getFieldNumber()
          + " in node '" + iterationNode.getPactContract().getName() + "'. Contradicting types between the " +
          "result of the iteration and the solution set schema: " + e.getPreviousType() +
          " and " + e.getNewType() + ". Most probable cause: Invalid constant field annotations.");
      }
     
      // set the serializers and comparators
      if (createUtilities) {
        WorksetIterationNode optNode = iterationNode.getIterationNode();
        iterationNode.setWorksetSerializer(createSerializer(wss, iterationNode.getWorksetPlanNode()));
        iterationNode.setSolutionSetSerializer(createSerializer(sss, iterationNode.getSolutionSetPlanNode()));
        try {
          iterationNode.setSolutionSetComparator(createComparator(optNode.getSolutionSetKeyFields(), null, sss));
        } catch (MissingFieldTypeInfoException ex) {
          throw new CompilerPostPassException("Could not set up the solution set for workset iteration '" +
              optNode.getPactContract().getName() + "'. Missing type information for key field " + ex.getFieldNumber() + '.');
        }
      }
     
      // done, we can now propagate our info down
      try {
        propagateToChannel(schema, iterationNode.getInitialSolutionSetInput(), createUtilities);
        propagateToChannel(wss, iterationNode.getInitialWorksetInput(), createUtilities);
      } catch (MissingFieldTypeInfoException ex) {
        throw new CompilerPostPassException("Could not set up runtime strategy for input channel to node '"
          + iterationNode.getPactContract().getName() + "'. Missing type information for key field " +
          ex.getFieldNumber());
      }
    }
    else if (node instanceof SingleInputPlanNode) {
      SingleInputPlanNode sn = (SingleInputPlanNode) node;
     
      // get the nodes current schema
      T schema;
      if (sn.postPassHelper == null) {
        schema = createEmptySchema();
        sn.postPassHelper = schema;
      } else {
        schema = (T) sn.postPassHelper;
      }
      schema.increaseNumConnectionsThatContributed();
      SingleInputNode optNode = sn.getSingleInputNode();
     
      // add the parent schema to the schema
      if (propagateParentSchemaDown) {
        addSchemaToSchema(parentSchema, schema, optNode, 0);
      }
     
      // check whether all outgoing channels have not yet contributed. come back later if not.
      if (schema.getNumConnectionsThatContributed() < sn.getOutgoingChannels().size()) {
        return;
      }
     
      // add the nodes local information
      try {
        getSingleInputNodeSchema(sn, schema);
      } catch (ConflictingFieldTypeInfoException e) {
        throw new CompilerPostPassException(getConflictingTypeErrorMessage(e, optNode.getPactContract().getName()));
      }
     
      if (createUtilities) {
        // parameterize the node's driver strategy
        if (sn.getDriverStrategy().requiresComparator()) {
          try {
            sn.setComparator(createComparator(sn.getKeys(), sn.getSortOrders(), schema));
          } catch (MissingFieldTypeInfoException e) {
            throw new CompilerPostPassException("Could not set up runtime strategy for node '" +
                optNode.getPactContract().getName() + "'. Missing type information for key field " +
                e.getFieldNumber());
          }
        }
      }
     
      // done, we can now propagate our info down
      try {
        propagateToChannel(schema, sn.getInput(), createUtilities);
      } catch (MissingFieldTypeInfoException e) {
        throw new CompilerPostPassException("Could not set up runtime strategy for input channel to node '" +
          optNode.getPactContract().getName() + "'. Missing type information for field " + e.getFieldNumber());
      }
     
      // don't forget the broadcast inputs
      for (Channel c: sn.getBroadcastInputs()) {
        try {
          propagateToChannel(createEmptySchema(), c, createUtilities);
        } catch (MissingFieldTypeInfoException e) {
          throw new CompilerPostPassException("Could not set up runtime strategy for broadcast channel in node '" +
            optNode.getPactContract().getName() + "'. Missing type information for field " + e.getFieldNumber());
View Full Code Here

      System.out.println(json);
    }
   
    SourcePlanNode vertexSource = or.getNode(VERTEX_SOURCE);
    SourcePlanNode edgesSource = or.getNode(EDGES_SOURCE);
    SinkPlanNode sink = or.getNode(SINK);
    WorksetIterationPlanNode iter = or.getNode(ITERATION_NAME);
   
    DualInputPlanNode neighborsJoin = or.getNode(JOIN_NEIGHBORS_MATCH);
    DualInputPlanNode cogroup = or.getNode(MIN_ID_AND_UPDATE);
   
    // --------------------------------------------------------------------
    // Plan validation:
    //
    // We expect the plan to go with a sort-merge join, because the CoGroup
    // sorts and the join in the successive iteration can re-exploit the sorting.
    // --------------------------------------------------------------------
   
    // test all drivers
    Assert.assertEquals(DriverStrategy.NONE, sink.getDriverStrategy());
    Assert.assertEquals(DriverStrategy.NONE, vertexSource.getDriverStrategy());
    Assert.assertEquals(DriverStrategy.NONE, edgesSource.getDriverStrategy());
   
    Assert.assertEquals(DriverStrategy.MERGE, neighborsJoin.getDriverStrategy());
    Assert.assertEquals(set0, neighborsJoin.getKeysForInput1());
    Assert.assertEquals(set0, neighborsJoin.getKeysForInput2());
   
    Assert.assertEquals(DriverStrategy.CO_GROUP, cogroup.getDriverStrategy());
    Assert.assertEquals(set0, cogroup.getKeysForInput1());
    Assert.assertEquals(set0, cogroup.getKeysForInput2());
   
    // test all the shipping strategies
    Assert.assertEquals(ShipStrategyType.FORWARD, sink.getInput().getShipStrategy());
    Assert.assertEquals(ShipStrategyType.PARTITION_HASH, iter.getInitialSolutionSetInput().getShipStrategy());
    Assert.assertEquals(set0, iter.getInitialSolutionSetInput().getShipStrategyKeys());
    Assert.assertEquals(ShipStrategyType.PARTITION_HASH, iter.getInitialWorksetInput().getShipStrategy());
    Assert.assertEquals(set0, iter.getInitialWorksetInput().getShipStrategyKeys());
   
    Assert.assertEquals(ShipStrategyType.FORWARD, neighborsJoin.getInput1().getShipStrategy()); // workset
    Assert.assertEquals(ShipStrategyType.PARTITION_HASH, neighborsJoin.getInput2().getShipStrategy()); // edges
    Assert.assertEquals(set0, neighborsJoin.getInput2().getShipStrategyKeys());
    Assert.assertTrue(neighborsJoin.getInput2().getTempMode().isCached());
   
    Assert.assertEquals(ShipStrategyType.PARTITION_HASH, cogroup.getInput1().getShipStrategy()); // min id
    Assert.assertEquals(ShipStrategyType.FORWARD, cogroup.getInput2().getShipStrategy()); // solution set
   
    // test all the local strategies
    Assert.assertEquals(LocalStrategy.NONE, sink.getInput().getLocalStrategy());
    Assert.assertEquals(LocalStrategy.NONE, iter.getInitialSolutionSetInput().getLocalStrategy());
   
    // the sort for the neighbor join in the first iteration is pushed out of the loop
    Assert.assertEquals(LocalStrategy.SORT, iter.getInitialWorksetInput().getLocalStrategy());
    Assert.assertEquals(LocalStrategy.NONE, neighborsJoin.getInput1().getLocalStrategy()); // workset
View Full Code Here

        plan = compileNoStats(p);
      }
     
      // get the optimizer plan nodes
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(plan);
      SinkPlanNode sink = resolver.getNode("Word Counts");
      SingleInputPlanNode reducer = resolver.getNode("Count Words");
      SingleInputPlanNode mapper = resolver.getNode("Tokenize Lines");
     
      // verify the strategies
      Assert.assertEquals(ShipStrategyType.FORWARD, mapper.getInput().getShipStrategy());
      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());
View Full Code Here

      } else {
        plan = compileNoStats(p);
      }
     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(plan);
      SinkPlanNode sink = resolver.getNode("Word Counts");
      SingleInputPlanNode reducer = resolver.getNode("Count Words");
      SingleInputPlanNode mapper = resolver.getNode("Tokenize Lines");
     
      Assert.assertEquals(ShipStrategyType.FORWARD, mapper.getInput().getShipStrategy());
      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());
View Full Code Here

 
  private void checkPlan(OptimizedPlan plan) {
   
    OptimizerPlanNodeResolver or = getOptimizerPlanNodeResolver(plan);
   
    final SinkPlanNode sink = or.getNode(SINK);
    final SingleInputPlanNode reducer = or.getNode(REDUCER_NAME);
    final SingleInputPlanNode combiner = (SingleInputPlanNode) reducer.getPredecessor();
    final SingleInputPlanNode mapper = or.getNode(MAPPER_NAME);
   
    final BulkIterationPlanNode iter = or.getNode(ITERATION_NAME);
   
    // -------------------- outside the loop -----------------------
   
    // check the sink
    assertEquals(ShipStrategyType.FORWARD, sink.getInput().getShipStrategy());
    assertEquals(LocalStrategy.NONE, sink.getInput().getLocalStrategy());
   
    // check the iteration
    assertEquals(ShipStrategyType.FORWARD, iter.getInput().getShipStrategy());
    assertEquals(LocalStrategy.NONE, iter.getInput().getLocalStrategy());
   
View Full Code Here

      // compile
      final OptimizedPlan plan = compileNoStats(p);
      final OptimizerPlanNodeResolver or = getOptimizerPlanNodeResolver(plan);
     
      // get the nodes from the final plan
      final SinkPlanNode sink = or.getNode("Output");
      final SingleInputPlanNode reducer = or.getNode("AggLio");
      final SingleInputPlanNode combiner = reducer.getPredecessor() instanceof SingleInputPlanNode ?
          (SingleInputPlanNode) reducer.getPredecessor() : null;
      final DualInputPlanNode join = or.getNode("JoinLiO");
      final SingleInputPlanNode filteringMapper = or.getNode("FilterO");
View Full Code Here

      // compile
      final OptimizedPlan plan = compileWithStats(p);
      final OptimizerPlanNodeResolver or = getOptimizerPlanNodeResolver(plan);
     
      // get the nodes from the final plan
      final SinkPlanNode sink = or.getNode("Output");
      final SingleInputPlanNode reducer = or.getNode("AggLio");
      final SingleInputPlanNode combiner = reducer.getPredecessor() instanceof SingleInputPlanNode ?
          (SingleInputPlanNode) reducer.getPredecessor() : null;
      final DualInputPlanNode join = or.getNode("JoinLiO");
      final SingleInputPlanNode filteringMapper = or.getNode("FilterO");
View Full Code Here

 
  private void checkPlan(OptimizedPlan plan) {
   
    OptimizerPlanNodeResolver or = getOptimizerPlanNodeResolver(plan);
   
    final SinkPlanNode sink = or.getNode(SINK);
    final SingleInputPlanNode reducer = or.getNode(REDUCER_NAME);
    final SingleInputPlanNode combiner = (SingleInputPlanNode) reducer.getPredecessor();
    final SingleInputPlanNode mapper = or.getNode(MAPPER_NAME);
   
    // check the mapper
    assertEquals(1, mapper.getBroadcastInputs().size());
    assertEquals(ShipStrategyType.FORWARD, mapper.getInput().getShipStrategy());
    assertEquals(ShipStrategyType.BROADCAST, mapper.getBroadcastInputs().get(0).getShipStrategy());
   
    assertEquals(LocalStrategy.NONE, mapper.getInput().getLocalStrategy());
    assertEquals(LocalStrategy.NONE, mapper.getBroadcastInputs().get(0).getLocalStrategy());
   
    assertEquals(DriverStrategy.COLLECTOR_MAP, mapper.getDriverStrategy());
   
    assertNull(mapper.getInput().getLocalStrategyKeys());
    assertNull(mapper.getInput().getLocalStrategySortOrder());
    assertNull(mapper.getBroadcastInputs().get(0).getLocalStrategyKeys());
    assertNull(mapper.getBroadcastInputs().get(0).getLocalStrategySortOrder());
   
   
    // check the combiner
    Assert.assertNotNull(combiner);
    assertEquals(ShipStrategyType.FORWARD, combiner.getInput().getShipStrategy());
    assertEquals(LocalStrategy.NONE, combiner.getInput().getLocalStrategy());
    assertEquals(DriverStrategy.SORTED_GROUP_COMBINE, combiner.getDriverStrategy());
    assertNull(combiner.getInput().getLocalStrategyKeys());
    assertNull(combiner.getInput().getLocalStrategySortOrder());
    assertEquals(set0, combiner.getKeys());
   
    // check the reducer
    assertEquals(ShipStrategyType.PARTITION_HASH, reducer.getInput().getShipStrategy());
    assertEquals(LocalStrategy.COMBININGSORT, reducer.getInput().getLocalStrategy());
    assertEquals(DriverStrategy.SORTED_GROUP_REDUCE, reducer.getDriverStrategy());
    assertEquals(set0, reducer.getKeys());
    assertEquals(set0, reducer.getInput().getLocalStrategyKeys());
    assertTrue(Arrays.equals(reducer.getInput().getLocalStrategySortOrder(), reducer.getSortOrders()));
   
    // check the sink
    assertEquals(ShipStrategyType.FORWARD, sink.getInput().getShipStrategy());
    assertEquals(LocalStrategy.NONE, sink.getInput().getLocalStrategy());
  }
View Full Code Here

TOP

Related Classes of eu.stratosphere.compiler.plan.SinkPlanNode

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.