public abstract class ReducingBarrierStep<S,E> extends AbstractStep<S,E> implements Barrier<E>, Generating<E,E>
| Modifier and Type | Class and Description | 
|---|---|
| static class  | ReducingBarrierStep.NonEmittingSeedA class that represents a value that is not be to be emitted which helps with flow control internal to the class
 and is serializable in Gryo for use in OLAP. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected boolean | hasProcessedOnce | 
| static Object | NON_EMITTING_SEEDA seed value not to be emitted from the  ReducingBarrierStephelping with flow control within this step. | 
| protected BinaryOperator<E> | reducingBiOperator | 
| protected Supplier<E> | seedSupplierIf the  seedSupplierisnullthen the default behavior is to generate the seed from the starts. | 
id, labels, nextEnd, nextStep, previousStep, starts, traversal, traverserStepIdAndLabelsSetByChild| Constructor and Description | 
|---|
| ReducingBarrierStep(Traversal.Admin traversal) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addBarrier(E barrier)Add a barrier to the step. | 
| ReducingBarrierStep<S,E> | clone()Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication. | 
| void | done()A way to hard set that the barrier is complete. | 
| protected E | generateSeedFromStarts()If the  seedSupplierisnullthen this method is called. | 
| BinaryOperator<E> | getBiOperator() | 
| MemoryComputeKey<E> | getMemoryComputeKey()The  MemoryComputeKeythat will be used by this step. | 
| Supplier<E> | getSeedSupplier()Gets the provided seed supplier or provides  generateSeedFromStarts(). | 
| boolean | hasNextBarrier()Whether or not the step has an accessible barrier. | 
| E | nextBarrier()Get the next barrier within this step. | 
| void | processAllStarts()Process all left traversers by do not yield the resultant output. | 
| Traverser.Admin<E> | processNextStart() | 
| abstract E | projectTraverser(Traverser.Admin<S> traverser) | 
| void | reset()Reset the state of the step such that it has no incoming starts. | 
| void | setReducingBiOperator(BinaryOperator<E> reducingBiOperator) | 
| void | setSeedSupplier(Supplier<E> seedSupplier) | 
addLabel, addStart, addStarts, equals, getId, getLabels, getNextStep, getPreviousStep, getStarts, getTraversal, hashCode, hasNext, hasStarts, isTraverserStepIdAndLabelsSetByChild, next, prepareTraversalForNextStep, removeLabel, setId, setNextStep, setPreviousStep, setTraversal, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitgenerateFinalResultequals, getRequirementsforEachRemaining, removepublic static final Object NON_EMITTING_SEED
ReducingBarrierStep helping with flow control within this step.protected Supplier<E> seedSupplier
seedSupplier is null then the default behavior is to generate the seed from the starts.
 This supplier must be callable as a constant and not rely on state from the class. Prefer overriding
 generateSeedFromStarts() otherwise.protected BinaryOperator<E> reducingBiOperator
protected boolean hasProcessedOnce
public ReducingBarrierStep(Traversal.Admin traversal)
public Supplier<E> getSeedSupplier()
generateSeedFromStarts().protected E generateSeedFromStarts()
seedSupplier is null then this method is called.public abstract E projectTraverser(Traverser.Admin<S> traverser)
public void setReducingBiOperator(BinaryOperator<E> reducingBiOperator)
public BinaryOperator<E> getBiOperator()
public void reset()
Steppublic void done()
Barrierpublic void processAllStarts()
BarrierReducingBarrierStep, where traversers can be processed "on the fly" and thus, reduce memory consumption.processAllStarts in interface Barrier<E>public boolean hasNextBarrier()
BarrierhasNextBarrier in interface Barrier<E>public E nextBarrier()
BarriernextBarrier in interface Barrier<E>public void addBarrier(E barrier)
BarrieraddBarrier in interface Barrier<E>barrier - the barrier to merge inpublic Traverser.Admin<E> processNextStart()
processNextStart in class AbstractStep<S,E>public ReducingBarrierStep<S,E> clone()
StepStep.reset() is called. Moreover, the previous and next steps should be set to EmptyStep.public MemoryComputeKey<E> getMemoryComputeKey()
MemoryComputingMemoryComputeKey that will be used by this step.getMemoryComputeKey in interface MemoryComputing<E>Copyright © 2013–2022 Apache Software Foundation. All rights reserved.