Package org.apache.flink.compiler.plan

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


   
    // check the optimized Plan
    // when reducer 1 distributes its data across the instances of map2, it needs to employ a local hash method,
    // because map2 has twice as many instances and key/value pairs with the same key need to be processed by the same
    // mapper respectively reducer
    SinkPlanNode sinkNode = oPlan.getDataSinks().iterator().next();
    SingleInputPlanNode red2Node = (SingleInputPlanNode) sinkNode.getPredecessor();
    SingleInputPlanNode map2Node = (SingleInputPlanNode) red2Node.getPredecessor();
   
    ShipStrategyType mapIn = map2Node.getInput().getShipStrategy();
    ShipStrategyType reduceIn = red2Node.getInput().getShipStrategy();
   
View Full Code Here


   
    // check the optimized Plan
    // when reducer 1 distributes its data across the instances of map2, it needs to employ a local hash method,
    // because map2 has twice as many instances and key/value pairs with the same key need to be processed by the same
    // mapper respectively reducer
    SinkPlanNode sinkNode = oPlan.getDataSinks().iterator().next();
    SingleInputPlanNode red2Node = (SingleInputPlanNode) sinkNode.getPredecessor();
   
    Assert.assertEquals("The Reduce 2 Node has an invalid local strategy.", LocalStrategy.SORT, red2Node.getInput().getLocalStrategy());
  }
View Full Code Here

     
      // the all-reduce has no combiner, when the DOP of the input is one
     
      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 DOP
      assertEquals(1, sourceNode.getDegreeOfParallelism());
      assertEquals(1, reduceNode.getDegreeOfParallelism());
      assertEquals(1, sinkNode.getDegreeOfParallelism());
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
      e.printStackTrace();
      fail(e.getClass().getSimpleName() + " in test: " + 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 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_REDUCE, reduceNode.getDriverStrategy());
      assertEquals(DriverStrategy.ALL_REDUCE, 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());
      e.printStackTrace();
      fail(e.getClass().getSimpleName() + " in test: " + 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 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_REDUCE, reduceNode.getDriverStrategy());
      assertEquals(DriverStrategy.SORTED_PARTIAL_REDUCE, combineNode.getDriverStrategy());
     
      // check the keys
      assertEquals(new FieldList(1), reduceNode.getKeys(0));
      assertEquals(new FieldList(1), combineNode.getKeys(0));
      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());
      e.printStackTrace();
      fail(e.getClass().getSimpleName() + " in test: " + 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 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_REDUCE, reduceNode.getDriverStrategy());
      assertEquals(DriverStrategy.SORTED_PARTIAL_REDUCE, combineNode.getDriverStrategy());
     
      // check the keys
      assertEquals(new FieldList(0), reduceNode.getKeys(0));
      assertEquals(new FieldList(0), combineNode.getKeys(0));
      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();
      fail(e.getClass().getSimpleName() + " in test: " + e.getMessage());
View Full Code Here

     
      // the all-reduce has no combiner, when the DOP of the input is one
     
      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 reduce has the right strategy
      assertEquals(DriverStrategy.ALL_GROUP_REDUCE, reduceNode.getDriverStrategy());
     
      // check DOP
      assertEquals(1, sourceNode.getDegreeOfParallelism());
      assertEquals(1, reduceNode.getDegreeOfParallelism());
      assertEquals(1, sinkNode.getDegreeOfParallelism());
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
      e.printStackTrace();
      fail(e.getClass().getSimpleName() + " in test: " + 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 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());
      e.printStackTrace();
      fail(e.getClass().getSimpleName() + " in test: " + 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();
      fail(e.getClass().getSimpleName() + " in test: " + e.getMessage());
View Full Code Here

TOP

Related Classes of org.apache.flink.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.