Package org.apache.flink.compiler.plan

Examples of org.apache.flink.compiler.plan.SingleInputPlanNode


     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(op);
     
      // get the original nodes
      SourcePlanNode sourceNode = resolver.getNode("source");
      SingleInputPlanNode reduceNode = resolver.getNode("reducer");
      SinkPlanNode sinkNode = resolver.getNode("sink");
     
      // get the combiner
      SingleInputPlanNode combineNode = (SingleInputPlanNode) reduceNode.getInput().getSource();
     
      // check wiring
      assertEquals(sourceNode, combineNode.getInput().getSource());
      assertEquals(reduceNode, sinkNode.getInput().getSource());
     
      // check that both reduce and combiner have the same strategy
      assertEquals(DriverStrategy.ALL_GROUP_REDUCE, reduceNode.getDriverStrategy());
      assertEquals(DriverStrategy.ALL_GROUP_COMBINE, combineNode.getDriverStrategy());
     
      // check DOP
      assertEquals(8, sourceNode.getDegreeOfParallelism());
      assertEquals(8, combineNode.getDegreeOfParallelism());
      assertEquals(1, reduceNode.getDegreeOfParallelism());
      assertEquals(1, sinkNode.getDegreeOfParallelism());
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
View Full Code Here


     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(op);
     
      // get the original nodes
      SourcePlanNode sourceNode = resolver.getNode("source");
      SingleInputPlanNode reduceNode = resolver.getNode("reducer");
      SinkPlanNode sinkNode = resolver.getNode("sink");
     
      // check wiring
      assertEquals(sourceNode, reduceNode.getInput().getSource());
      assertEquals(reduceNode, sinkNode.getInput().getSource());
     
      // 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(0));
      assertEquals(new FieldList(1), reduceNode.getInput().getLocalStrategyKeys());
     
      // check DOP
      assertEquals(6, sourceNode.getDegreeOfParallelism());
      assertEquals(8, reduceNode.getDegreeOfParallelism());
      assertEquals(8, sinkNode.getDegreeOfParallelism());
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
      e.printStackTrace();
View Full Code Here

     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(op);
     
      // get the original nodes
      SourcePlanNode sourceNode = resolver.getNode("source");
      SingleInputPlanNode reduceNode = resolver.getNode("reducer");
      SinkPlanNode sinkNode = resolver.getNode("sink");
     
      // get the combiner
      SingleInputPlanNode combineNode = (SingleInputPlanNode) reduceNode.getInput().getSource();
     
      // check wiring
      assertEquals(sourceNode, combineNode.getInput().getSource());
      assertEquals(reduceNode, sinkNode.getInput().getSource());
     
      // check that both reduce and combiner have the same strategy
      assertEquals(DriverStrategy.SORTED_GROUP_REDUCE, reduceNode.getDriverStrategy());
      assertEquals(DriverStrategy.SORTED_GROUP_COMBINE, combineNode.getDriverStrategy());
     
      // check the keys
      assertEquals(new FieldList(1), reduceNode.getKeys(0));
      assertEquals(new FieldList(1), combineNode.getKeys(0));
      assertEquals(new FieldList(1), combineNode.getKeys(1));
      assertEquals(new FieldList(1), reduceNode.getInput().getLocalStrategyKeys());
     
      // check DOP
      assertEquals(6, sourceNode.getDegreeOfParallelism());
      assertEquals(6, combineNode.getDegreeOfParallelism());
      assertEquals(8, reduceNode.getDegreeOfParallelism());
      assertEquals(8, sinkNode.getDegreeOfParallelism());
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
View Full Code Here

     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(op);
     
      // get the original nodes
      SourcePlanNode sourceNode = resolver.getNode("source");
      SingleInputPlanNode reduceNode = resolver.getNode("reducer");
      SinkPlanNode sinkNode = resolver.getNode("sink");
     
      // get the key extractors and projectors
      SingleInputPlanNode keyExtractor = (SingleInputPlanNode) reduceNode.getInput().getSource();
      SingleInputPlanNode keyProjector = (SingleInputPlanNode) sinkNode.getInput().getSource();
     
      // check wiring
      assertEquals(sourceNode, keyExtractor.getInput().getSource());
      assertEquals(keyProjector, sinkNode.getInput().getSource());
     
      // check that both reduce and combiner have the same strategy
      assertEquals(DriverStrategy.SORTED_GROUP_REDUCE, reduceNode.getDriverStrategy());
     
      // check the keys
      assertEquals(new FieldList(0), reduceNode.getKeys(0));
      assertEquals(new FieldList(0), reduceNode.getInput().getLocalStrategyKeys());
     
      // check DOP
      assertEquals(6, sourceNode.getDegreeOfParallelism());
      assertEquals(6, keyExtractor.getDegreeOfParallelism());
     
      assertEquals(8, reduceNode.getDegreeOfParallelism());
      assertEquals(8, keyProjector.getDegreeOfParallelism());
      assertEquals(8, sinkNode.getDegreeOfParallelism());
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
      e.printStackTrace();
View Full Code Here

     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(op);
     
      // get the original nodes
      SourcePlanNode sourceNode = resolver.getNode("source");
      SingleInputPlanNode reduceNode = resolver.getNode("reducer");
      SinkPlanNode sinkNode = resolver.getNode("sink");
     
      // get the combiner
      SingleInputPlanNode combineNode = (SingleInputPlanNode) reduceNode.getInput().getSource();
     
      // get the key extractors and projectors
      SingleInputPlanNode keyExtractor = (SingleInputPlanNode) combineNode.getInput().getSource();
      SingleInputPlanNode keyProjector = (SingleInputPlanNode) sinkNode.getInput().getSource();
     
      // check wiring
      assertEquals(sourceNode, keyExtractor.getInput().getSource());
      assertEquals(keyProjector, sinkNode.getInput().getSource());
     
      // check that both reduce and combiner have the same strategy
      assertEquals(DriverStrategy.SORTED_GROUP_REDUCE, reduceNode.getDriverStrategy());
      assertEquals(DriverStrategy.SORTED_GROUP_COMBINE, combineNode.getDriverStrategy());
     
      // check the keys
      assertEquals(new FieldList(0), reduceNode.getKeys(0));
      assertEquals(new FieldList(0), combineNode.getKeys(0));
      assertEquals(new FieldList(0), combineNode.getKeys(1));
      assertEquals(new FieldList(0), reduceNode.getInput().getLocalStrategyKeys());
     
      // check DOP
      assertEquals(6, sourceNode.getDegreeOfParallelism());
      assertEquals(6, keyExtractor.getDegreeOfParallelism());
      assertEquals(6, combineNode.getDegreeOfParallelism());
     
      assertEquals(8, reduceNode.getDegreeOfParallelism());
      assertEquals(8, keyProjector.getDegreeOfParallelism());
      assertEquals(8, sinkNode.getDegreeOfParallelism());
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
      e.printStackTrace();
View Full Code Here

        for (Iterator<PlanNode> iter = list.iterator(); iter.hasNext();) {
          PlanNode in = iter.next();
          if (in.getOriginalOptimizerNode().getPactContract() == c) {
            // is this the child or is our node the child
            if (in instanceof SingleInputPlanNode && n instanceof SingleInputPlanNode) {
              SingleInputPlanNode thisNode = (SingleInputPlanNode) n;
              SingleInputPlanNode otherNode = (SingleInputPlanNode) in;
             
              if (thisNode.getPredecessor() == otherNode) {
                // other node is child, remove it
                iter.remove();
              } else if (otherNode.getPredecessor() == thisNode) {
                shouldAdd = false;
              }
            } else {
              throw new RuntimeException("Unrecodnized case in test.");
            }
View Full Code Here

TOP

Related Classes of org.apache.flink.compiler.plan.SingleInputPlanNode

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.