Class CallStep<S,E>
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep<S,E>
-
- org.apache.tinkerpop.gremlin.process.traversal.step.map.CallStep<S,E>
-
- All Implemented Interfaces:
Serializable
,AutoCloseable
,Cloneable
,Iterator<Traverser.Admin<E>>
,Step<S,E>
,Configuring
,Parameterizing
,TraversalParent
public final class CallStep<S,E> extends AbstractStep<S,E> implements TraversalParent, AutoCloseable, Configuring
Reference implementation for service calls via theServiceRegistry
andService
APIs. This step can be used to start a traversal or it can be used mid-traversal with one at a time or barrier execution.- Author:
- Mike Personick (http://github.com/mikepersonick)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep
id, labels, nextEnd, nextStep, previousStep, starts, traversal, traverserStepIdAndLabelsSetByChild
-
-
Constructor Summary
Constructors Constructor Description CallStep(Traversal.Admin traversal, boolean isStart)
CallStep(Traversal.Admin traversal, boolean isStart, String service)
CallStep(Traversal.Admin traversal, boolean isStart, String service, Map staticParams)
CallStep(Traversal.Admin traversal, boolean isStart, String service, Map staticParams, Traversal.Admin<S,Map> mapTraversal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CallStep<S,E>
clone()
Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication.void
close()
protected void
closeIterator()
void
configure(Object... keyValues)
Accept a configuration to theStep
.protected CloseableIterator
flatMap(Traverser.Admin<S> traverser)
protected CloseableIterator
flatMap(TraverserSet<S> traverserSet)
<S,E>
List<Traversal.Admin<S,E>>getLocalChildren()
protected Map
getMergedParams()
protected Map
getMergedParams(Traverser.Admin<S> traverser)
protected Map
getMergedParams(TraverserSet<S> traverserSet)
Parameters
getParameters()
Gets the parameters on the step.Set<TraverserRequirement>
getRequirements()
Provide the necessaryTraverserRequirement
that must be met by the traverser in order for the step to function properly.protected ServiceRegistry
getServiceRegistry()
int
hashCode()
protected Traverser.Admin<E>
processNextStart()
void
reset()
Reset the state of the step such that it has no incoming starts.protected Service<S,E>
service()
void
setTraversal(Traversal.Admin<?,?> parentTraversal)
Set theTraversal
that this step is contained within.protected CloseableIterator
start()
String
toString()
-
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep
addLabel, addStart, addStarts, clearLabels, equals, getId, getLabels, getNextStep, getPreviousStep, getStarts, getTraversal, hasNext, hasStarts, isTraverserStepIdAndLabelsSetByChild, next, prepareTraversalForNextStep, removeLabel, setId, setNextStep, setPreviousStep
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent
addGlobalChild, addLocalChild, asStep, getGlobalChildren, getSelfAndChildRequirements, integrateChild, removeGlobalChild, removeLocalChild, replaceLocalChild
-
-
-
-
Constructor Detail
-
CallStep
public CallStep(Traversal.Admin traversal, boolean isStart)
-
CallStep
public CallStep(Traversal.Admin traversal, boolean isStart, String service)
-
CallStep
public CallStep(Traversal.Admin traversal, boolean isStart, String service, Map staticParams)
-
CallStep
public CallStep(Traversal.Admin traversal, boolean isStart, String service, Map staticParams, Traversal.Admin<S,Map> mapTraversal)
-
-
Method Detail
-
processNextStart
protected Traverser.Admin<E> processNextStart()
- Specified by:
processNextStart
in classAbstractStep<S,E>
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceTraversalParent
-
closeIterator
protected void closeIterator()
-
getMergedParams
protected Map getMergedParams()
-
getMergedParams
protected Map getMergedParams(Traverser.Admin<S> traverser)
-
getMergedParams
protected Map getMergedParams(TraverserSet<S> traverserSet)
-
start
protected CloseableIterator start()
-
flatMap
protected CloseableIterator flatMap(Traverser.Admin<S> traverser)
-
flatMap
protected CloseableIterator flatMap(TraverserSet<S> traverserSet)
-
getServiceRegistry
protected ServiceRegistry getServiceRegistry()
-
reset
public void reset()
Description copied from interface:Step
Reset the state of the step such that it has no incoming starts. Internal states are to be reset, but any sideEffect data structures are not to be recreated.
-
getLocalChildren
public <S,E> List<Traversal.Admin<S,E>> getLocalChildren()
- Specified by:
getLocalChildren
in interfaceTraversalParent
-
setTraversal
public void setTraversal(Traversal.Admin<?,?> parentTraversal)
Description copied from interface:Step
Set theTraversal
that this step is contained within.- Specified by:
setTraversal
in interfaceStep<S,E>
- Overrides:
setTraversal
in classAbstractStep<S,E>
- Parameters:
parentTraversal
- the new traversal for this step
-
getRequirements
public Set<TraverserRequirement> getRequirements()
Description copied from interface:Step
Provide the necessaryTraverserRequirement
that must be met by the traverser in order for the step to function properly. The provided default implements returns an empty set.- Specified by:
getRequirements
in interfaceStep<S,E>
- Returns:
- the set of requirements
-
toString
public String toString()
- Overrides:
toString
in classAbstractStep<S,E>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractStep<S,E>
-
clone
public CallStep<S,E> clone()
Description copied from interface:Step
Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication. When cloning a step, it is important that the steps, the cloned step is equivalent to the state of the step whenStep.reset()
is called. Moreover, the previous and next steps should be set toEmptyStep
.
-
configure
public void configure(Object... keyValues)
Description copied from interface:Configuring
Accept a configuration to theStep
. Note that this interface extendsParameterizing
and so there is an expectation that theStep
implementation will have aParameters
instance that will house any values passed to this method. Storing these configurations inParameters
is not a requirement however, IF the configuration is an expected option for the step and can be stored on a member field that can be accessed on the step by more direct means (i.e. like a getter method).- Specified by:
configure
in interfaceConfiguring
-
getParameters
public Parameters getParameters()
Description copied from interface:Parameterizing
Gets the parameters on the step.- Specified by:
getParameters
in interfaceParameterizing
-
-