public class JanusGraphTraversalUtil extends Object
| Constructor and Description |
|---|
JanusGraphTraversalUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> |
findMostOuterEligibleStart(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
In case `step` can be considered as eligible start step then
this method returns the most outer eligible parent step.
|
static MultiQueryPositions |
getAllMultiQueryPositionsForMultiQueriable(MultiQueriable<?,?> multiQueriable,
boolean multiNestedRepeatEligible,
boolean multiNestedRepeatNextIterationEligible)
Backtraces the traversal for the position where a MultiQueriable step would expect its corresponding
JanusGraphMultiQueryStep(s).
|
static Optional<org.apache.tinkerpop.gremlin.process.traversal.Step> |
getEndMultiQueryPosition(org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin repeatTraversal)
Returns multi query position for the end of the traversal.
|
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 Optional<Integer> |
getLocalNonMultiQueryProvidedBatchSize(MultiQueriable<?,?> multiQueriable)
Returns local barrier step size if that barrier step is not generated by JanusGraphMultiQueryStep.
|
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) |
static boolean |
isStartStep(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
Checks if the provided step is the start step of its Traversal skipping any `IdentityStep`, `NoOpBarrierStep`,
`SideEffectStep`, `ProfileStep`, and `JanusGraphMultiQueryStep` steps at the beginning.
|
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 org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> findMostOuterEligibleStart(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
public static boolean isMultiQueryCompatibleParent(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
public static MultiQueryPositions getAllMultiQueryPositionsForMultiQueriable(MultiQueriable<?,?> multiQueriable, boolean multiNestedRepeatEligible, boolean multiNestedRepeatNextIterationEligible)
multiQueriable - The MultiQuery compatible step whose MultiQueryStep positions shall be searched.public static Optional<org.apache.tinkerpop.gremlin.process.traversal.Step> getEndMultiQueryPosition(org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin repeatTraversal)
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 Optional<Integer> getLocalNonMultiQueryProvidedBatchSize(MultiQueriable<?,?> multiQueriable)
public static boolean isStartStep(org.apache.tinkerpop.gremlin.process.traversal.Step<?,?> step)
step - Step to check.public 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.