All Superinterfaces:
MemoryComputing<B>
All Known Subinterfaces:
FilteringBarrier<S>, LocalBarrier<S>, RangeGlobalStepContract<S>, TailGlobalStepContract<S>
All Known Implementing Classes:
AggregateStep, CollectingBarrierStep, CountGlobalStep, DedupGlobalStep, FoldStep, GroupCountSideEffectStep, GroupCountStep, GroupSideEffectStep, GroupStep, LambdaCollectingBarrierStep, MaxGlobalStep, MeanGlobalStep, MinGlobalStep, NoOpBarrierStep, OrderGlobalStep, ProfilingAware.ProfiledBarrier, RangeGlobalStep, RangeGlobalStepPlaceholder, ReducingBarrierStep, SampleGlobalStep, SideEffectBarrierStep, SideEffectCapStep, SubgraphStep, SumGlobalStep, SupplyingBarrierStep, TailGlobalStep, TailGlobalStepPlaceholder, TreeSideEffectStep, TreeStep

public interface Barrier<B> extends MemoryComputing<B>
A Barrier is any step that requires all left traversers to be processed prior to emitting result traversers to the right. Note that some barrier steps may be "lazy" in that if their algorithm permits, they can emit right traversers prior to all traversers being aggregated. A barrier is the means by which a distributed step in TraversalVertexProgram is synchronized and made to behave a single step. All Barrier steps implement MemoryComputing as that is how barriers communicate with one another in GraphComputer.
Author:
Marko A. Rodriguez (http://markorodriguez.com)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addBarrier(B barrier)
    Add a barrier to the step.
    default void
    A way to hard set that the barrier is complete.
    If a barrier is unproductive then provide an empty object suitable to the implementation which can be used to represent that state.
    boolean
    Whether or not the step has an accessible barrier.
    Get the next barrier within this step.
    void
    Process all left traversers by do not yield the resultant output.

    Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.MemoryComputing

    getMemoryComputeKey
  • Method Details

    • processAllStarts

      void processAllStarts()
      Process all left traversers by do not yield the resultant output. This method is useful for steps like ReducingBarrierStep, where traversers can be processed "on the fly" and thus, reduce memory consumption.
    • hasNextBarrier

      boolean hasNextBarrier()
      Whether or not the step has an accessible barrier.
      Returns:
      whether a barrier exists or not
    • nextBarrier

      B nextBarrier() throws NoSuchElementException
      Get the next barrier within this step. Barriers from parallel steps can be the be merged to create a single step with merge barriers.
      Returns:
      the next barrier of the step
      Throws:
      NoSuchElementException
    • addBarrier

      void addBarrier(B barrier)
      Add a barrier to the step. This typically happens when multiple parallel barriers need to become one barrier at a single step.
      Parameters:
      barrier - the barrier to merge in
    • done

      default void done()
      A way to hard set that the barrier is complete. This is necessary when parallel barriers don't all have barriers and need hard resetting. The default implementation does nothing.
    • getEmptyBarrier

      B getEmptyBarrier()
      If a barrier is unproductive then provide an empty object suitable to the implementation which can be used to represent that state. This is important for cases like by(out().order().fold()) where the order() might filter but the fold() means the traversal is productive.