Class MergeEdgeStep<S>
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep<S,E>
-
- org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStep<S,E>
-
- org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeStep<S,Edge,Object>
-
- org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeEdgeStep<S>
-
- All Implemented Interfaces:
Serializable
,AutoCloseable
,Cloneable
,Iterator<Traverser.Admin<Edge>>
,Step<S,Edge>
,Configuring
,Deleting<Event>
,Mutating<Event>
,Parameterizing
,TraversalOptionParent<Merge,S,Object>
,TraversalParent
,Writing<Event>
public class MergeEdgeStep<S> extends MergeStep<S,Edge,Object>
Implementation for themergeE()
step covering both the start step version and the one used mid-traversal.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeStep
callbackRegistry, first, isStart, mergeTraversal, onCreateTraversal, onMatchTraversal
-
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 MergeEdgeStep(Traversal.Admin traversal, boolean isStart)
MergeEdgeStep(Traversal.Admin traversal, boolean isStart, Map merge)
MergeEdgeStep(Traversal.Admin traversal, boolean isStart, Traversal.Admin<S,Map> mergeTraversal)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChildOption(Merge token, Traversal.Admin<S,Object> traversalOption)
MergeEdgeStep<S>
clone()
Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication.protected Iterator<Edge>
flatMap(Traverser.Admin<S> traverser)
protected Set
getAllowedTokens()
Traversal.Admin<S,Object>
getInVTraversal()
Gets the traversal that will be used to provide theMap
that will be used to identify the Direction.IN vertex during merge.<S,C>
List<Traversal.Admin<S,C>>getLocalChildren()
Traversal.Admin<S,Object>
getOutVTraversal()
Gets the traversal that will be used to provide theMap
that will be used to identify the Direction.OUT vertex during merge.int
hashCode()
protected Map
onCreateMap(Traverser.Admin<S> traverser, Map unresolvedMergeMap, Map mergeMap)
void
reset()
Reset the state of the step such that it has no incoming starts.protected Vertex
resolveVertex(Object arg)
protected void
resolveVertex(Merge token, Direction direction, Map map, Traverser.Admin<S> traverser, Traversal.Admin<S,Object> traversal)
protected Vertex
resolveVertex(Traverser.Admin<S> traverser, Traversal.Admin<S,Object> traversal)
protected Map<?,?>
resolveVertices(Map map, Traverser.Admin<S> traverser)
protected CloseableIterator<Edge>
searchEdges(Map search)
Translate the Map into search criteria.void
setTraversal(Traversal.Admin<?,?> parentTraversal)
Set theTraversal
that this step is contained within.String
toString()
protected Vertex
tryAttachVertex(Vertex v)
static void
validateMapInput(Map map, boolean ignoreTokens)
-
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeStep
configure, getCallbackRegistry, getGraph, getMergeTraversal, getMutatingCallbackRegistry, getOnCreateTraversal, getOnMatchTraversal, getParameters, getRequirements, isFirst, isStart, materializeMap, processNextStart, searchVertices, searchVerticesLabelConstraint, searchVerticesPropertyConstraints, searchVerticesTraversal, validate, validate, validateNoOverrides
-
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStep
closeIterator
-
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep
addLabel, addStart, addStarts, 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, close, getGlobalChildren, getSelfAndChildRequirements, integrateChild, removeGlobalChild, removeLocalChild, replaceLocalChild
-
-
-
-
Constructor Detail
-
MergeEdgeStep
public MergeEdgeStep(Traversal.Admin traversal, boolean isStart)
-
MergeEdgeStep
public MergeEdgeStep(Traversal.Admin traversal, boolean isStart, Map merge)
-
MergeEdgeStep
public MergeEdgeStep(Traversal.Admin traversal, boolean isStart, Traversal.Admin<S,Map> mergeTraversal)
-
-
Method Detail
-
validateMapInput
public static void validateMapInput(Map map, boolean ignoreTokens)
-
getOutVTraversal
public Traversal.Admin<S,Object> getOutVTraversal()
Gets the traversal that will be used to provide theMap
that will be used to identify the Direction.OUT vertex during merge.
-
getInVTraversal
public Traversal.Admin<S,Object> getInVTraversal()
Gets the traversal that will be used to provide theMap
that will be used to identify the Direction.IN vertex during merge.
-
addChildOption
public void addChildOption(Merge token, Traversal.Admin<S,Object> traversalOption)
Description copied from interface:TraversalOptionParent
The child as defined by the token it takes, likePick
orMerge
. This traversal may be of local or global scope depending on the step implementation that works withoption()
.- Specified by:
addChildOption
in interfaceTraversalOptionParent<Merge,S,Object>
- Overrides:
addChildOption
in classMergeStep<S,Edge,Object>
-
getLocalChildren
public <S,C> List<Traversal.Admin<S,C>> getLocalChildren()
- Specified by:
getLocalChildren
in interfaceTraversalParent
- Overrides:
getLocalChildren
in classMergeStep<S,Edge,Object>
-
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.
-
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,Edge>
- Overrides:
setTraversal
in classMergeStep<S,Edge,Object>
- Parameters:
parentTraversal
- the new traversal for this step
-
clone
public MergeEdgeStep<S> 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
.
-
getAllowedTokens
protected Set getAllowedTokens()
- Specified by:
getAllowedTokens
in classMergeStep<S,Edge,Object>
-
searchEdges
protected CloseableIterator<Edge> searchEdges(Map search)
Translate the Map into search criteria. Default implementation is to translate the Map into a g.E() or g.V().out/inE() traversal. Graph providers will presumably optimize this traversal to use whatever indices are present and appropriate for efficiency. Callers are responsible for closing this iterator when finished.
-
resolveVertices
protected Map<?,?> resolveVertices(Map map, Traverser.Admin<S> traverser)
-
resolveVertex
protected void resolveVertex(Merge token, Direction direction, Map map, Traverser.Admin<S> traverser, Traversal.Admin<S,Object> traversal)
-
flatMap
protected Iterator<Edge> flatMap(Traverser.Admin<S> traverser)
-
onCreateMap
protected Map onCreateMap(Traverser.Admin<S> traverser, Map unresolvedMergeMap, Map mergeMap)
-
resolveVertex
protected Vertex resolveVertex(Traverser.Admin<S> traverser, Traversal.Admin<S,Object> traversal)
-
-