Package cascading.flow.planner.iso.expression

Examples of cascading.flow.planner.iso.expression.ElementExpression


  {
  public StreamedAccumulatedBoundariesExpressionGraph()
    {
    super( SearchOrder.Depth );

    ElementExpression sink = new BoundariesElementExpression( ElementCapture.Secondary );

    this.arc(
      new BoundariesElementExpression( ElementCapture.Primary ),
      PathScopeExpression.ALL_NON_BLOCKING,
      sink
View Full Code Here


  {
  public StreamedAccumulatedTapsExpressionGraph()
    {
    super( SearchOrder.Depth );

    ElementExpression sink = or(
      ElementCapture.Secondary,
      new FlowElementExpression( Tap.class ),
      new FlowElementExpression( Group.class )
    );
View Full Code Here

  {
  public NonBlockedBlockedJoinJoinExpressionGraph()
    {
    super( SearchOrder.ReverseDepth );

    ElementExpression source = OrElementExpression.or( ElementCapture.Primary, new FlowElementExpression( Tap.class ), new FlowElementExpression( Group.class ) );
    ElementExpression blocking = or( new FlowElementExpression( HashJoin.class ), new FlowElementExpression( Group.class ) );
    ElementExpression sink = new FlowElementExpression( ElementCapture.Secondary, HashJoin.class );

    this.arc(
      source,
      PathScopeExpression.ANY,
      blocking
View Full Code Here

  {
  public NonBlockedBlockedJoinExpressionGraph()
    {
    super( SearchOrder.ReverseDepth );

    ElementExpression source = OrElementExpression.or( ElementCapture.Primary, new FlowElementExpression( Tap.class ), new FlowElementExpression( Group.class ) );
    ElementExpression sink = new FlowElementExpression( ElementCapture.Secondary, HashJoin.class );

    this.arc(
      source,
      PathScopeExpression.ANY_NON_BLOCKING,
      sink
View Full Code Here

    TopologicalOrderIterator<FlowElement, Scope> 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;
    }
View Full Code Here

    Set<ElementExpression> elementExpressions = matchExpression.getDelegate().vertexSet();

    if( elementExpressions.size() != 1 )
      throw new IllegalStateException( "may not search multiple matches against multi-node expression: " + matchExpression );

    ElementExpression expression = Util.getFirst( elementExpressions );

    if( expression.getCapture() != ElementCapture.Primary )
      throw new IllegalStateException( "capture on expression must be Primary: " + expression );

    Set<FlowElement> foundElements = new LinkedHashSet<>();

    // no evidence elementGraph.vertexSet().iterator(); is faster without modifying jgrapht
    Iterator<FlowElement> iterator = SearchOrder.getNodeIterator( matchExpression.getSearchOrder(), elementGraph );

    while( iterator.hasNext() )
      {
      FlowElement flowElement = iterator.next();

      if( exclusions.contains( flowElement ) )
        continue;

      if( expression.applies( plannerContext, elementGraph, flowElement ) )
        foundElements.add( flowElement );
      }

    // we are only capturing Primary distinguished elements
    return new Match( matchExpression, elementGraph, null, foundElements, Collections.<Scope>emptySet() )
View Full Code Here

    Map<ScopeExpression, Set<Scope>> edgeMapping = new HashMap<>();

    DirectedMultigraph<ElementExpression, ScopeExpression> delegate = matchExpression.getDelegate();
    for( ScopeExpression scopeExpression : delegate.edgeSet() )
      {
      ElementExpression lhs = delegate.getEdgeSource( scopeExpression );
      ElementExpression rhs = delegate.getEdgeTarget( scopeExpression );

      FlowElement lhsElement = vertexMapping.get( lhs );
      FlowElement rhsElement = vertexMapping.get( rhs );

      Set<Scope> edges = elementGraph.getAllEdges( lhsElement, rhsElement );
View Full Code Here

TOP

Related Classes of cascading.flow.planner.iso.expression.ElementExpression

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.