Class MergeElementStep<S,E,C>
- 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.MergeElementStep<S,E,C>
 
 
 
- 
- All Implemented Interfaces:
- Serializable,- AutoCloseable,- Cloneable,- Iterator<Traverser.Admin<E>>,- Step<S,E>,- Deleting<Event>,- MergeStepContract<S,E,C>,- Mutating<Event>,- PopContaining,- PropertiesHolder,- TraversalOptionParent<Merge,S,C>,- TraversalParent,- Writing<Event>
 - Direct Known Subclasses:
- MergeEdgeStep,- MergeVertexStep
 
 public abstract class MergeElementStep<S,E,C> extends FlatMapStep<S,E> implements MergeStepContract<S,E,C> Abstract base class for themergeV/E()implementations.- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.PopContainingPopContaining.PopInstruction
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected CallbackRegistry<Event>callbackRegistryprotected booleanfirstprotected booleanisStartprotected Traversal.Admin<S,Map>mergeTraversalprotected Traversal.Admin<S,Map>onCreateTraversalprotected Traversal.Admin<S,Map<String,?>>onMatchTraversalprotected booleanusesPartitionStrategy- 
Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStepid, labels, nextEnd, nextStep, previousStep, starts, traversal, traverserStepIdAndLabelsSetByChild
 - 
Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeStepContractCONCRETE_STEPS
 
- 
 - 
Constructor SummaryConstructors Constructor Description MergeElementStep(Traversal.Admin traversal, boolean isStart)MergeElementStep(Traversal.Admin traversal, boolean isStart, Map mergeMap)MergeElementStep(Traversal.Admin traversal, boolean isStart, Traversal.Admin mergeTraversal)
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddChildOption(Merge token, Traversal.Admin<S,C> traversalOption)voidaddProperty(Object key, Object value)This implementation should only be used as a mechanism for supportingPartitionStrategy.MergeElementStep<S,E,C>clone()Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication.protected abstract Iterator<E>flatMap(Traverser.Admin<S> traverser)protected abstract SetgetAllowedTokens()CallbackRegistry<Event>getCallbackRegistry()protected GraphgetGraph()<S,C>
 List<Traversal.Admin<S,C>>getLocalChildren()Gets a list of all "local" child traversals for this step.Traversal.Admin<S,Map>getMergeTraversal()Gets the traversal that will be used to provide theMapthat will be used to search for elements.CallbackRegistry<Event>getMutatingCallbackRegistry()Gets the callback registry for events that the step raises.Traversal.Admin<S,Map>getOnCreateTraversal()Gets the traversal that will be used to provide theMapthat will be used to create elements that do not match the search criteria ofgetMergeTraversal().Traversal.Admin<S,Map<String,?>>getOnMatchTraversal()Gets the traversal that will be used to provide theMapthat will be used to modify elements that match the search criteria ofgetMergeTraversal().Map<Object,List<Object>>getProperties()Set<TraverserRequirement>getRequirements()Provide the necessaryTraverserRequirementthat must be met by the traverser in order for the step to function properly.inthashCode()booleanisFirst()Determine if this is the first pass throughprocessNextStart().booleanisStart()Determines if this is a start step.booleanisUsingPartitionStrategy()protected MapmaterializeMap(Traverser.Admin<S> traverser, Traversal.Admin<S,?> mapTraversal)null Map == empty Mapprotected Traverser.Admin<E>processNextStart()booleanremoveProperty(Object k)voidreset()Reset the state of the step such that it has no incoming starts.protected CloseableIterator<Vertex>searchVertices(Map search)Translate the Map into a g.V() traversal against the supplied graph.protected GraphTraversalsearchVerticesLabelConstraint(GraphTraversal t, String label)protected GraphTraversalsearchVerticesPropertyConstraints(GraphTraversal t, Map search)protected GraphTraversalsearchVerticesTraversal(Graph graph, Object id)voidsetMerge(Traversal.Admin<?,Map<Object,Object>> mergeTraversal)voidsetOnCreate(Traversal.Admin<?,Map<Object,Object>> onCreateTraversal)voidsetOnMatch(Traversal.Admin<?,Map<Object,Object>> onMatchTraversal)voidsetTraversal(Traversal.Admin<?,?> parentTraversal)Set theTraversalthat this step is contained within.StringtoString()protected voidvalidate(Map map, boolean ignoreTokens)protected static voidvalidate(Map map, boolean ignoreTokens, Set allowedTokens, String op)protected voidvalidateNoOverrides(Map<?,?> mergeMap, Map<?,?> onCreateMap)Prohibit overrides to the existence criteria (id/label/from/to) in onCreate.- 
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStepcloseIterator
 - 
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStepaddLabel, 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.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.util.IteratorforEachRemaining, remove
 - 
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeStepContractgetMergeMapWithGValue, getOnCreateMapWithGValue, getOnMatchMapWithGValue
 - 
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.PropertiesHoldergetPropertiesWithGValues
 - 
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParentaddGlobalChild, addLocalChild, asStep, close, getGlobalChildren, getPopInstructions, getSelfAndChildRequirements, integrateChild, removeGlobalChild, removeLocalChild, replaceLocalChild
 
- 
 
- 
- 
- 
Field Detail- 
isStartprotected final boolean isStart 
 - 
firstprotected boolean first 
 - 
mergeTraversalprotected Traversal.Admin<S,Map> mergeTraversal 
 - 
onCreateTraversalprotected Traversal.Admin<S,Map> onCreateTraversal 
 - 
onMatchTraversalprotected Traversal.Admin<S,Map<String,?>> onMatchTraversal 
 - 
callbackRegistryprotected CallbackRegistry<Event> callbackRegistry 
 - 
usesPartitionStrategyprotected boolean usesPartitionStrategy 
 
- 
 - 
Constructor Detail- 
MergeElementSteppublic MergeElementStep(Traversal.Admin traversal, boolean isStart) 
 - 
MergeElementSteppublic MergeElementStep(Traversal.Admin traversal, boolean isStart, Map mergeMap) 
 - 
MergeElementSteppublic MergeElementStep(Traversal.Admin traversal, boolean isStart, Traversal.Admin mergeTraversal) 
 
- 
 - 
Method Detail- 
getMergeTraversalpublic Traversal.Admin<S,Map> getMergeTraversal() Gets the traversal that will be used to provide theMapthat will be used to search for elements. ThisMapalso will be used as the default data set to be used to create the element if the search is not successful.- Specified by:
- getMergeTraversalin interface- MergeStepContract<S,E,C>
 
 - 
getOnCreateTraversalpublic Traversal.Admin<S,Map> getOnCreateTraversal() Gets the traversal that will be used to provide theMapthat will be used to create elements that do not match the search criteria ofgetMergeTraversal().- Specified by:
- getOnCreateTraversalin interface- MergeStepContract<S,E,C>
 
 - 
getOnMatchTraversalpublic Traversal.Admin<S,Map<String,?>> getOnMatchTraversal() Gets the traversal that will be used to provide theMapthat will be used to modify elements that match the search criteria ofgetMergeTraversal().- Specified by:
- getOnMatchTraversalin interface- MergeStepContract<S,E,C>
 
 - 
isStartpublic boolean isStart() Determines if this is a start step.- Specified by:
- isStartin interface- MergeStepContract<S,E,C>
 
 - 
isFirstpublic boolean isFirst() Determine if this is the first pass throughprocessNextStart().- Specified by:
- isFirstin interface- MergeStepContract<S,E,C>
 
 - 
getCallbackRegistrypublic CallbackRegistry<Event> getCallbackRegistry() 
 - 
addChildOptionpublic void addChildOption(Merge token, Traversal.Admin<S,C> traversalOption) Description copied from interface:TraversalOptionParentThe child as defined by the token it takes, likePickorMerge. This traversal may be of local or global scope depending on the step implementation that works withoption().- Specified by:
- addChildOptionin interface- TraversalOptionParent<S,E,C>
 
 - 
getLocalChildrenpublic <S,C> List<Traversal.Admin<S,C>> getLocalChildren() Description copied from interface:TraversalParentGets a list of all "local" child traversals for this step. A "local" traversal is one which is evaluated independently for each incoming traverser to the parent step. This is typically used in cases where the child is used to process or augment each traverser individually. SeeLocalSteporByModulatingas examples.- Specified by:
- getLocalChildrenin interface- TraversalParent
 
 - 
isUsingPartitionStrategypublic boolean isUsingPartitionStrategy() - Specified by:
- isUsingPartitionStrategyin interface- MergeStepContract<S,E,C>
 
 - 
processNextStartprotected Traverser.Admin<E> processNextStart() - Overrides:
- processNextStartin class- FlatMapStep<S,E>
 
 - 
getGraphprotected Graph getGraph() 
 - 
getMutatingCallbackRegistrypublic CallbackRegistry<Event> getMutatingCallbackRegistry() Description copied from interface:MutatingGets the callback registry for events that the step raises.- Specified by:
- getMutatingCallbackRegistryin interface- Mutating<S>
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- AbstractStep<S,E>
 
 - 
resetpublic void reset() Description copied from interface:StepReset 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.
 - 
getRequirementspublic Set<TraverserRequirement> getRequirements() Description copied from interface:StepProvide the necessaryTraverserRequirementthat must be met by the traverser in order for the step to function properly. The provided default implements returns an empty set.- Specified by:
- getRequirementsin interface- MergeStepContract<S,E,C>
- Specified by:
- getRequirementsin interface- Step<S,E>
- Returns:
- the set of requirements
 
 - 
toStringpublic String toString() - Overrides:
- toStringin class- AbstractStep<S,E>
 
 - 
setTraversalpublic void setTraversal(Traversal.Admin<?,?> parentTraversal) Description copied from interface:StepSet theTraversalthat this step is contained within.- Specified by:
- setTraversalin interface- Step<S,E>
- Overrides:
- setTraversalin class- AbstractStep<S,E>
- Parameters:
- parentTraversal- the new traversal for this step
 
 - 
clonepublic MergeElementStep<S,E,C> clone() Description copied from interface:StepCloning 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.
 - 
validateprotected void validate(Map map, boolean ignoreTokens) 
 - 
validateprotected static void validate(Map map, boolean ignoreTokens, Set allowedTokens, String op) 
 - 
validateNoOverridesprotected void validateNoOverrides(Map<?,?> mergeMap, Map<?,?> onCreateMap) Prohibit overrides to the existence criteria (id/label/from/to) in onCreate.
 - 
materializeMapprotected Map materializeMap(Traverser.Admin<S> traverser, Traversal.Admin<S,?> mapTraversal) null Map == empty Map
 - 
searchVerticesprotected CloseableIterator<Vertex> searchVertices(Map search) Translate the Map into a g.V() traversal against the supplied graph. 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.
 - 
searchVerticesTraversalprotected GraphTraversal searchVerticesTraversal(Graph graph, Object id) 
 - 
searchVerticesLabelConstraintprotected GraphTraversal searchVerticesLabelConstraint(GraphTraversal t, String label) 
 - 
searchVerticesPropertyConstraintsprotected GraphTraversal searchVerticesPropertyConstraints(GraphTraversal t, Map search) 
 - 
flatMapprotected abstract Iterator<E> flatMap(Traverser.Admin<S> traverser) - Specified by:
- flatMapin class- FlatMapStep<S,E>
 
 - 
getAllowedTokensprotected abstract Set getAllowedTokens() 
 - 
setMergepublic void setMerge(Traversal.Admin<?,Map<Object,Object>> mergeTraversal) - Specified by:
- setMergein interface- MergeStepContract<S,E,C>
 
 - 
setOnCreatepublic void setOnCreate(Traversal.Admin<?,Map<Object,Object>> onCreateTraversal) - Specified by:
- setOnCreatein interface- MergeStepContract<S,E,C>
 
 - 
setOnMatchpublic void setOnMatch(Traversal.Admin<?,Map<Object,Object>> onMatchTraversal) - Specified by:
- setOnMatchin interface- MergeStepContract<S,E,C>
 
 - 
addPropertypublic void addProperty(Object key, Object value) This implementation should only be used as a mechanism for supportingPartitionStrategy.- Specified by:
- addPropertyin interface- PropertiesHolder
 
 - 
getPropertiespublic Map<Object,List<Object>> getProperties() - Specified by:
- getPropertiesin interface- PropertiesHolder
 
 - 
removePropertypublic boolean removeProperty(Object k) - Specified by:
- removePropertyin interface- PropertiesHolder
 
 
- 
 
-