Package cascading.flow.planner.graph

Examples of cascading.flow.planner.graph.ElementGraph


public class GraphFinderTest extends CascadingTestCase
  {
  @Test
  public void testFind()
    {
    ElementGraph graph = new HashJoinSameSourceGraph();

    graph = new ContractedTransformer( new SyncPipeExpressionGraph() ).transform( graph ).getEndGraph();

    FlowElementExpression SHARED_TAP = new FlowElementExpression( Tap.class, TypeExpression.Topo.SplitOnly );
    FlowElementExpression SHARED_HASHJOIN = new FlowElementExpression( HashJoin.class );
View Full Code Here


    }

  @Test
  public void testFind2()
    {
    ElementGraph graph = new HashJoinSameSourceGraph();

    graph = new ContractedTransformer( new SyncPipeExpressionGraph() ).transform( graph ).getEndGraph();

    FlowElementExpression sharedTap = new FlowElementExpression( Tap.class, TypeExpression.Topo.SplitOnly );
    FlowElementExpression sharedHashJoin = new FlowElementExpression( HashJoin.class );
View Full Code Here

  @Test
  public void testFindAllOnPrimary()
    {
//    ElementGraph graph = new HashJoinSameSourceGraph();
    ElementGraph graph = new JoinAroundJoinRightMostGraph();
    graph.writeDOT( getPlanPath() + "/full.dot" );

//    graph = new ContractedTransform( new SyncPipeExpressionGraph() ).transform( graph ).getEndGraph();
    graph = new ContractedTransformer( new NoGroupTapExpressionGraph() ).transform( graph ).getEndGraph();

    graph.writeDOT( getPlanPath() + "/contracted.dot" );

    ExpressionGraph expressionGraph = new ExpressionGraph()
      .arc(
        new FlowElementExpression( Tap.class ),
        ScopeExpression.ALL,
View Full Code Here

  @Test
  public void testFindAllMatched()
    {
//    ElementGraph graph = new HashJoinSameSourceGraph();
    ElementGraph graph = new JoinAroundJoinRightMostGraph();
    graph.writeDOT( getPlanPath() + "/full.dot" );

//    graph = new ContractedTransform( new SyncPipeExpressionGraph() ).transform( graph ).getEndGraph();
    graph = new ContractedTransformer( new NoGroupTapExpressionGraph() ).transform( graph ).getEndGraph();

    graph.writeDOT( getPlanPath() + "/contracted.dot" );

    ExpressionGraph expressionGraph = new ExpressionGraph( new FlowElementExpression( ElementCapture.Primary, Tap.class ) );

    GraphFinder graphFinder = new GraphFinder( expressionGraph );
View Full Code Here

    RemoveBranchGraphTransformer removeTransformer = new RemoveBranchGraphTransformer( new TestMalformedJoinExpressionGraph() );

    int count = 0;
    while( iterator.hasNext() )
      {
      ElementGraph next = iterator.next();
      assertNotNull( next );
      next.writeDOT( getPlanPath() + "/pipeline/" + count + "-graph.dot" );

      Transformed<ElementGraph> result = removeTransformer.transform( next );

      result.getEndGraph().writeDOT( getPlanPath() + "/pipeline/" + count + "-cleaned-graph.dot" );
View Full Code Here

    iterator.getContractedGraph().writeDOT( getPlanPath() + "/node-contracted.dot" );

    int count = 0;
    while( iterator.hasNext() && count < 10 )
      {
      ElementGraph next = iterator.next();
      assertNotNull( next );
      next.writeDOT( getPlanPath() + "/pipeline/" + count + "-graph.dot" );

      count++;
      }

    assertEquals( "wrong number of sub-graphs", numSubGraphs, count );
View Full Code Here

  @Override
  public Transformed<ElementGraph> transform( PlannerContext plannerContext, ElementGraph rootGraph )
    {
    Transformed<ElementGraph> result = new Transformed<>( plannerContext, this, rootGraph );

    ElementGraph graphCopy = rootGraph.copyGraph();

    Transformed<ElementGraph> transformed = graphTransformer.transform( plannerContext, graphCopy );

    result.addChildTransform( transformed );
View Full Code Here

    Map<ElementGraph, List<? extends ElementGraph>> subGraphs = new LinkedHashMap<>();

    for( Map.Entry<ElementGraph, List<? extends ElementGraph>> entry : priorResults.entrySet() )
      {
      ElementGraph parent = entry.getKey();
      List<? extends ElementGraph> priors = entry.getValue();

      List<ElementGraph> resultChildren = new ArrayList<>( priors );

      Set<FlowElement> exclusions = getExclusions( priors, partitioner.getAnnotationExcludes() );

      for( ElementGraph child : priors )
        {
        ElementGraph priorAnnotated = annotateWithPriors( child, priors );

        Partitions partitions = partitioner.partition( plannerContext, priorAnnotated, exclusions );

        writeTrace( ruleResult, phase, rule, parent, child, partitions );
View Full Code Here

    Map<ElementGraph, List<? extends ElementGraph>> subGraphs = new LinkedHashMap<>();

    for( Map.Entry<ElementGraph, List<? extends ElementGraph>> entry : priorResults.entrySet() )
      {
      ElementGraph parent = entry.getKey();
      List<? extends ElementGraph> priors = entry.getValue();

      Set<FlowElement> exclusions = getExclusions( priors, partitioner.getAnnotationExcludes() );
      ElementGraph priorAnnotated = annotateWithPriors( parent, priors );

      Partitions partitions = partitioner.partition( plannerContext, priorAnnotated, exclusions );

      writeTrace( ruleResult, phase, rule, parent, null, partitions );
View Full Code Here

    Map<ElementGraph, List<? extends ElementGraph>> levelResults = ruleResult.getLevelResults( phase.getLevel() );

    for( Map.Entry<ElementGraph, List<? extends ElementGraph>> entry : levelResults.entrySet() )
      {
      ElementGraph parent = entry.getKey(); // null for root case
      List<? extends ElementGraph> children = entry.getValue();

      for( ElementGraph child : children )
        {
        Asserted asserted = rule.assertion( plannerContext, child );
View Full Code Here

TOP

Related Classes of cascading.flow.planner.graph.ElementGraph

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.