public class JanusGraphTraversalUtil extends Object
| Constructor and Description |
|---|
JanusGraphTraversalUtil() |
| Modifier and Type | Method and Description |
|---|---|
static List<org.apache.tinkerpop.gremlin.process.traversal.Step> |
getAllMultiQueryPositionsForMultiQueriable(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> multiQueriable)
Backtraces the traversal for the position where a MultiQueriable step would expect its corresponding
JanusGraphMultiQueryStep(s).
|
static StandardJanusGraph |
getJanusGraph(org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin<?,?> traversal) |
static Optional<StandardJanusGraphTx> |
getJanusGraphTx(org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin<?,?> traversal) |
static JanusGraphVertex |
getJanusGraphVertex(org.apache.tinkerpop.gremlin.structure.Element v) |
static JanusGraphVertex |
getJanusGraphVertex(org.apache.tinkerpop.gremlin.process.traversal.Traverser<? extends org.apache.tinkerpop.gremlin.structure.Element> traverser) |
static Optional<org.apache.tinkerpop.gremlin.process.traversal.Step> |
getLocalMultiQueryPositionForStep(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
For a MultiQuery compatible step, this method searches the correct position in the step's traversal at which
a
JanusGraphMultiQueryStep should be inserted. |
static org.apache.tinkerpop.gremlin.process.traversal.Step |
getNextNonIdentityStep(org.apache.tinkerpop.gremlin.process.traversal.Step start) |
static <S> Optional<S> |
getPreviousStepOfClass(Class<S> stepClass,
org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> start)
Starting at the given step, this method searches the traversal backwards to find the most recent step which
matches the given class.
|
static List<org.apache.tinkerpop.gremlin.process.traversal.Step> |
getSteps(Predicate<org.apache.tinkerpop.gremlin.process.traversal.Step> predicate,
org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin<?,?> traversal)
Returns a list of steps from the traversal, which match a given predicate.
|
static JanusGraphTransaction |
getTx(org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin<?,?> traversal) |
static boolean |
isEdgeReturnStep(JanusGraphVertexStep vertexStep) |
static boolean |
isLegalMultiQueryPosition(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
This method closely matches the behavior implemented in
LazyBarrierStrategy which ensures that
no NoOpBarrierSteps are inserted if path labels are required. |
static boolean |
isMultiQueryCompatibleParent(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
Checks whether this step is a traversal parent for which a preceding
JanusGraphMultiQueryStep
can have a positive impact on the step's child traversals. |
static boolean |
isMultiQueryCompatibleStep(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
Checks whether a step can profit of a preceding
JanusGraphMultiQueryStep. |
static boolean |
isVertexReturnStep(JanusGraphVertexStep vertexStep) |
public static StandardJanusGraph getJanusGraph(org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin<?,?> traversal)
public static Optional<StandardJanusGraphTx> getJanusGraphTx(org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin<?,?> traversal)
public static JanusGraphVertex getJanusGraphVertex(org.apache.tinkerpop.gremlin.structure.Element v)
public static JanusGraphVertex getJanusGraphVertex(org.apache.tinkerpop.gremlin.process.traversal.Traverser<? extends org.apache.tinkerpop.gremlin.structure.Element> traverser)
public static boolean isEdgeReturnStep(JanusGraphVertexStep vertexStep)
public static boolean isVertexReturnStep(JanusGraphVertexStep vertexStep)
public static org.apache.tinkerpop.gremlin.process.traversal.Step getNextNonIdentityStep(org.apache.tinkerpop.gremlin.process.traversal.Step start)
public static JanusGraphTransaction getTx(org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin<?,?> traversal)
public static List<org.apache.tinkerpop.gremlin.process.traversal.Step> getAllMultiQueryPositionsForMultiQueriable(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> multiQueriable)
multiQueriable - The MultiQuery compatible step whose MultiQueryStep positions shall be searched.public static Optional<org.apache.tinkerpop.gremlin.process.traversal.Step> getLocalMultiQueryPositionForStep(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
JanusGraphMultiQueryStep should be inserted. Only the traversal of the given step is considered,
parent and child traversals are not taken into account.step - The MultiQuery compatible step.JanusGraphMultiQueryStep should be inserted.JanusGraphMultiQuerySteppublic static boolean isMultiQueryCompatibleParent(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
JanusGraphMultiQueryStep
can have a positive impact on the step's child traversals.step - The step to be checked.true if the step's child traversals can possibly benefit of a preceding
JanusGraphMultiQueryStep, otherwise false.public static boolean isMultiQueryCompatibleStep(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
JanusGraphMultiQueryStep.step - The step for which the condition is checked.true if the step is either a MultiQueriable or is a MultiQuery compatible
parent step.MultiQueriablepublic static boolean isLegalMultiQueryPosition(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
LazyBarrierStrategy which ensures that
no NoOpBarrierSteps are inserted if path labels are required. Since the same limitation applies
to JanusGraphMultiQuerySteps, the definition of legal positions for this step is the same.step - The step which follows the JanusGraphMultiQueryStep to be inserted.true if no path labels are required for this position, otherwise false.LazyBarrierStrategypublic static <S> Optional<S> getPreviousStepOfClass(Class<S> stepClass, org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> start)
S - The class of the requested step.stepClass - The class of the requested step.start - The step from which the search is started.public static List<org.apache.tinkerpop.gremlin.process.traversal.Step> getSteps(Predicate<org.apache.tinkerpop.gremlin.process.traversal.Step> predicate, org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin<?,?> traversal)
predicate - Whether or not a step should be in the returned list.traversal - The traversal whose steps should be used.Copyright © 2012–2023. All rights reserved.