Tabnine Logo
Match.getMatchedGraph
Code IndexAdd Tabnine to your IDE (free)

How to use
getMatchedGraph
method
in
cascading.flow.planner.iso.finder.Match

Best Java code snippets using cascading.flow.planner.iso.finder.Match.getMatchedGraph (Showing top 10 results out of 315)

origin: cwensel/cascading

public ElementSubGraph getMatched()
 {
 return match.getMatchedGraph();
 }
origin: cwensel/cascading

 @Override
 public String toString()
  {
  final StringBuilder sb = new StringBuilder( "Match{" );
//    sb.append( "matcherGraph=" ).append( matcherGraph );
//    sb.append( ", mapping=" ).append( mapping );
  sb.append( getMatchedGraph() );
  sb.append( '}' );
  return sb.toString();
  }
 }
origin: cwensel/cascading

public EnumMultiMap<FlowElement> getCaptureMap()
 {
 if( captureMap != null )
  return captureMap;
 captureMap = new EnumMultiMap<>();
 Map<FlowElement, ElementExpression> reversed = new LinkedHashMap<>();
 if( Util.reverseMap( vertexMapping, reversed ) )
  throw new IllegalStateException( "duplicates found in mapping" );
 // returns a Set ordered topologically by the matched graph. retains this first, this second ordering for simple cases
 Iterator<FlowElement> iterator = ElementGraphs.getTopologicalIterator( getMatchedGraph() );
 while( iterator.hasNext() )
  {
  FlowElement next = iterator.next();
  ElementExpression elementExpression = reversed.get( next );
  // matchedGraph may be a super-set of what's in the mapping, so elementExpression may be null
  if( elementExpression == null )
   continue;
  captureMap.addAll( elementExpression.getCapture(), next );
  }
 return captureMap;
 }
origin: cwensel/cascading

@Override
public ElementGraph next()
 {
 try
  {
  if( !hasNext() )
   throw new NoSuchElementException();
  ElementGraph contractedMatchedGraph = match.getMatchedGraph();
  Set<FlowElement> excludes = getContractedGraph().vertexSetCopy();
  excludes.removeAll( contractedMatchedGraph.vertexSet() );
  return asSubGraph( elementGraph, contractedMatchedGraph, excludes );
  }
 finally
  {
  match = null;
  }
 }
origin: cwensel/cascading

@Override
public void writeDOTs( String path )
 {
 int count = 0;
 beginGraph.writeDOT( new File( path, makeFileName( count++, "element-graph" ) ).toString() );
 if( graphPartitioner instanceof ExpressionGraphPartitioner )
  {
  ExpressionGraphPartitioner expressionGraphPartitioner = (ExpressionGraphPartitioner) graphPartitioner;
  ExpressionGraph contractionGraph = expressionGraphPartitioner.getContractionGraph();
  if( contractionGraph != null )
   contractionGraph.writeDOT( new File( path, makeFileName( count++, "contraction-graph", contractionGraph ) ).toString() );
  ExpressionGraph expressionGraph = expressionGraphPartitioner.getExpressionGraph();
  if( expressionGraph != null )
   expressionGraph.writeDOT( new File( path, makeFileName( count++, "expression-graph", expressionGraph ) ).toString() );
  }
 if( contractedGraph != null )
  contractedGraph.writeDOT( new File( path, makeFileName( count++, "contracted-graph" ) ).toString() );
 List<ElementGraph> subGraphs = getSubGraphs();
 for( int i = 0; i < subGraphs.size(); i++ )
  {
  ElementGraph subGraph = subGraphs.get( i );
  // want to write annotations with elements
  new ElementMultiGraph( subGraph, annotatedSubGraphs.get( subGraph ) ).writeDOT( new File( path, makeFileName( count, i, "partition-result-sub-graph" ) ).toString() );
  if( i < contractedMatches.size() )
   contractedMatches.get( i ).getMatchedGraph().writeDOT( new File( path, makeFileName( count, i, "partition-contracted-graph" ) ).toString() );
  }
 }
origin: cwensel/cascading

public Transformed<ElementSubGraph> transform( PlannerContext plannerContext, ElementGraph rootGraph )
 {
 Transformed<ElementSubGraph> transformed = new Transformed<>( plannerContext, this, subGraphMatcher, rootGraph );
 try
  {
  Transformed contractedTransformed = graphTransformer.transform( plannerContext, rootGraph ); // contracted graph transform
  transformed.addChildTransform( contractedTransformed );
  // apply contracted sub-graph matcher to get the bounded sub-graph of the original graph
  ElementGraph contractedGraph = contractedTransformed.getEndGraph();
  Match match = findAllPrimaries ? subGraphFinder.findAllMatches( plannerContext, contractedGraph ) : subGraphFinder.findFirstMatch( plannerContext, contractedGraph );
  if( !match.foundMatch() )
   return transformed;
  ElementGraph contractedSubGraph = match.getMatchedGraph();
  ElementSubGraph resultSubGraph = asSubGraphOf( rootGraph, contractedSubGraph ); // the bounded sub-graph of the rootGraph
  transformed.setEndGraph( resultSubGraph );
  return transformed;
  }
 catch( Throwable throwable )
  {
  throw new TransformException( throwable, transformed );
  }
 }
origin: cwensel/cascading

@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 );
 ExpressionGraph expressionGraph = new ExpressionGraph()
  .arc( sharedTap, ScopeExpression.ALL, sharedHashJoin );
 GraphFinder graphFinder = new GraphFinder( expressionGraph );
 Match match = graphFinder.findFirstMatch( graph );
 match.getMatchedGraph().writeDOT( getPlanPath() + "/match.dot" );
 }
origin: cwensel/cascading

@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 );
 ExpressionGraph expressionGraph = new ExpressionGraph()
  .arcs( SHARED_TAP, SHARED_HASHJOIN )
  .arcs( SHARED_TAP, SHARED_HASHJOIN );
 GraphFinder graphFinder = new GraphFinder( expressionGraph );
 Match match = graphFinder.findFirstMatch( graph );
 match.getMatchedGraph().writeDOT( getPlanPath() + "/match.dot" );
 }
origin: cwensel/cascading

 @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 );

  Match match = graphFinder.findAllMatches( graph );

  match.getMatchedGraph().writeDOT( getPlanPath() + "/match.dot" );
  }
 }
origin: cwensel/cascading

 @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,
    new FlowElementExpression( ElementCapture.Primary, HashJoin.class )
   );

  GraphFinder graphFinder = new GraphFinder( expressionGraph );

  Match match = graphFinder.findAllMatchesOnPrimary( graph );

  match.getMatchedGraph().writeDOT( getPlanPath() + "/match.dot" );
  }

cascading.flow.planner.iso.finderMatchgetMatchedGraph

Popular methods of Match

  • <init>
  • foundMatch
  • getCaptureMap
  • getCapturedElements
  • getIncludedElements
  • getVertexMapping

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSupportFragmentManager (FragmentActivity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • JFileChooser (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now