本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.Step.getNextStep方法的典型用法代码示例。如果您正苦于以下问题:Java Step.getNextStep方法的具体用法?Java Step.getNextStep怎么用?Java Step.getNextStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.process.traversal.Step
的用法示例。
在下文中一共展示了Step.getNextStep方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.apache.tinkerpop.gremlin.process.traversal.Step; //导入方法依赖的package包/类
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
if (TraversalHelper.onGraphComputer(traversal))
return;
for (final GraphStep originalGraphStep : TraversalHelper.getStepsOfClass(GraphStep.class, traversal)) {
final TinkerGraphStep<?, ?> tinkerGraphStep = new TinkerGraphStep<>(originalGraphStep);
TraversalHelper.replaceStep(originalGraphStep, tinkerGraphStep, traversal);
Step<?, ?> currentStep = tinkerGraphStep.getNextStep();
while (currentStep instanceof HasStep || currentStep instanceof NoOpBarrierStep) {
if (currentStep instanceof HasStep) {
for (final HasContainer hasContainer : ((HasContainerHolder) currentStep).getHasContainers()) {
if (!GraphStep.processHasContainerIds(tinkerGraphStep, hasContainer))
tinkerGraphStep.addHasContainer(hasContainer);
}
TraversalHelper.copyLabels(currentStep, currentStep.getPreviousStep(), false);
traversal.removeStep(currentStep);
}
currentStep = currentStep.getNextStep();
}
}
}
示例2: apply
import org.apache.tinkerpop.gremlin.process.traversal.Step; //导入方法依赖的package包/类
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
for (final GraphStep originalGraphStep : TraversalHelper.getStepsOfClass(GraphStep.class, traversal)) {
final BitsyGraphStep<?, ?> bitsyGraphStep = new BitsyGraphStep<>(originalGraphStep);
TraversalHelper.replaceStep(originalGraphStep, bitsyGraphStep, traversal);
Step<?, ?> currentStep = bitsyGraphStep.getNextStep();
while (currentStep instanceof HasStep || currentStep instanceof NoOpBarrierStep) {
if (currentStep instanceof HasStep) {
for (final HasContainer hasContainer : ((HasContainerHolder) currentStep).getHasContainers()) {
if (!GraphStep.processHasContainerIds(bitsyGraphStep, hasContainer))
bitsyGraphStep.addHasContainer(hasContainer);
}
TraversalHelper.copyLabels(currentStep, currentStep.getPreviousStep(), false);
traversal.removeStep(currentStep);
}
currentStep = currentStep.getNextStep();
}
}
}
示例3: apply
import org.apache.tinkerpop.gremlin.process.traversal.Step; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
for (final VertexStep originalVertexStep : TraversalHelper.getStepsOfClass(VertexStep.class, traversal)) {
final HBaseVertexStep<?> hbaseVertexStep = new HBaseVertexStep<>(originalVertexStep);
TraversalHelper.replaceStep(originalVertexStep, hbaseVertexStep, traversal);
Step<?, ?> currentStep = hbaseVertexStep.getNextStep();
while (currentStep instanceof HasStep || currentStep instanceof NoOpBarrierStep) {
if (currentStep instanceof HasStep) {
for (final HasContainer hasContainer : ((HasContainerHolder) currentStep).getHasContainers()) {
hbaseVertexStep.addHasContainer(hasContainer);
}
TraversalHelper.copyLabels(currentStep, currentStep.getPreviousStep(), false);
traversal.removeStep(currentStep);
}
currentStep = currentStep.getNextStep();
}
}
}
示例4: apply
import org.apache.tinkerpop.gremlin.process.traversal.Step; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
for (final GraphStep originalGraphStep : TraversalHelper.getStepsOfClass(GraphStep.class, traversal)) {
final HBaseGraphStep<?, ?> hbaseGraphStep = new HBaseGraphStep<>(originalGraphStep);
TraversalHelper.replaceStep(originalGraphStep, hbaseGraphStep, traversal);
Step<?, ?> currentStep = hbaseGraphStep.getNextStep();
while (currentStep instanceof HasStep || currentStep instanceof NoOpBarrierStep) {
if (currentStep instanceof HasStep) {
for (final HasContainer hasContainer : ((HasContainerHolder) currentStep).getHasContainers()) {
if (!GraphStep.processHasContainerIds(hbaseGraphStep, hasContainer))
hbaseGraphStep.addHasContainer(hasContainer);
}
TraversalHelper.copyLabels(currentStep, currentStep.getPreviousStep(), false);
traversal.removeStep(currentStep);
}
currentStep = currentStep.getNextStep();
}
}
}
示例5: apply
import org.apache.tinkerpop.gremlin.process.traversal.Step; //导入方法依赖的package包/类
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
boolean modified;
do {
modified = false;
final List<Step> steps = traversal.getSteps();
int prevRank = 0;
for (int i = steps.size() - 1; i >= 0; i--) {
final Step curr = steps.get(i);
final int rank = rank(curr);
if (prevRank > 0 && rank > prevRank) {
final Step next = curr.getNextStep();
traversal.removeStep(next);
traversal.addStep(i, next);
modified = true;
}
prevRank = rank;
}
} while (modified);
}
示例6: removeToTraversal
import org.apache.tinkerpop.gremlin.process.traversal.Step; //导入方法依赖的package包/类
public static <S, E> void removeToTraversal(final Step<S, ?> startStep, final Step<?, E> endStep, final Traversal.Admin<S, E> newTraversal) {
final Traversal.Admin<?, ?> originalTraversal = startStep.getTraversal();
Step<?, ?> currentStep = startStep;
while (currentStep != endStep && !(currentStep instanceof EmptyStep)) {
final Step<?, ?> temp = currentStep.getNextStep();
originalTraversal.removeStep(currentStep);
newTraversal.addStep(currentStep);
currentStep = temp;
}
}
示例7: getReferencedLabelsAfterStep
import org.apache.tinkerpop.gremlin.process.traversal.Step; //导入方法依赖的package包/类
public static Set<String> getReferencedLabelsAfterStep(Step<?, ?> step) {
final Set<String> labels = new HashSet<>();
while (!(step instanceof EmptyStep)) {
labels.addAll(PathUtil.getReferencedLabels(step));
step = step.getNextStep();
}
return labels;
}
示例8: getReferencedLabels
import org.apache.tinkerpop.gremlin.process.traversal.Step; //导入方法依赖的package包/类
public static Set<String> getReferencedLabels(final Step step) {
final Set<String> referencedLabels = new HashSet<>();
if (step instanceof Parameterizing) { // TODO: we should really make the mutation steps Scoping :|
final Parameters parameters = ((Parameterizing) step).getParameters();
for (final Traversal.Admin trav : parameters.getTraversals()) {
for (final Object ss : trav.getSteps()) {
if (ss instanceof Scoping) {
for (String label : ((Scoping) ss).getScopeKeys()) {
referencedLabels.add(label);
}
}
}
}
}
if (step instanceof Scoping) {
final Set<String> labels = new HashSet<>(((Scoping) step).getScopeKeys());
if (step instanceof MatchStep) {
// if this is the last step, keep everything, else just add founds
if (step.getNextStep() instanceof EmptyStep) {
labels.addAll(((MatchStep) step).getMatchEndLabels());
labels.addAll(((MatchStep) step).getMatchStartLabels());
}
}
referencedLabels.addAll(labels);
}
return referencedLabels;
}
示例9: getFirstLegalOLAPStep
import org.apache.tinkerpop.gremlin.process.traversal.Step; //导入方法依赖的package包/类
private static Step<?, ?> getFirstLegalOLAPStep(Step<?, ?> currentStep) {
while (!(currentStep instanceof EmptyStep)) {
if (!(currentStep instanceof VertexComputing))
return currentStep;
currentStep = currentStep.getNextStep();
}
return EmptyStep.instance();
}
示例10: getLastLegalOLAPStep
import org.apache.tinkerpop.gremlin.process.traversal.Step; //导入方法依赖的package包/类
private static Step<?, ?> getLastLegalOLAPStep(Step<?, ?> currentStep) {
while (currentStep instanceof VertexComputing)
currentStep = currentStep.getNextStep();
while (!(currentStep instanceof EmptyStep)) {
if (currentStep instanceof VertexComputing)
return currentStep.getPreviousStep();
currentStep = currentStep.getNextStep();
}
return EmptyStep.instance();
}
示例11: apply
import org.apache.tinkerpop.gremlin.process.traversal.Step; //导入方法依赖的package包/类
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
if (!TraversalHelper.onGraphComputer(traversal))
return;
final boolean globalChild = TraversalHelper.isGlobalChild(traversal);
if (traversal.getParent() instanceof TraversalVertexProgramStep) {
if (TraversalHelper.getStepsOfAssignableClassRecursively(GraphStep.class, traversal).size() > 1)
throw new VerificationException("Mid-traversal V()/E() is currently not supported on GraphComputer", traversal);
if (TraversalHelper.hasStepOfAssignableClassRecursively(ProfileStep.class, traversal) && TraversalHelper.getStepsOfAssignableClass(VertexProgramStep.class, TraversalHelper.getRootTraversal(traversal)).size() > 1)
throw new VerificationException("Profiling a multi-VertexProgramStep traversal is currently not supported on GraphComputer", traversal);
}
for (final Step<?, ?> step : traversal.getSteps()) {
// only global children are graph computing
if (globalChild && step instanceof GraphComputing)
((GraphComputing) step).onGraphComputer();
// you can not traverse past the local star graph with localChildren (e.g. by()-modulators).
if (step instanceof TraversalParent) {
final Optional<Traversal.Admin<Object, Object>> traversalOptional = ((TraversalParent) step).getLocalChildren().stream()
.filter(t -> !TraversalHelper.isLocalStarGraph(t.asAdmin()))
.findAny();
if (traversalOptional.isPresent())
throw new VerificationException("Local traversals may not traverse past the local star-graph on GraphComputer: " + traversalOptional.get(), traversal);
}
// collecting barriers and dedup global use can only operate on the element and its properties (no incidences)
if (step instanceof CollectingBarrierStep && step instanceof TraversalParent) {
if (((TraversalParent) step).getLocalChildren().stream().filter(t -> !TraversalHelper.isLocalProperties(t)).findAny().isPresent())
throw new VerificationException("The following barrier step can not process the incident edges of a vertex on GraphComputer: " + step, traversal);
}
// this is a problem because sideEffect.merge() is transient on the OLAP reduction
if (TraversalHelper.getRootTraversal(traversal).getTraverserRequirements().contains(TraverserRequirement.ONE_BULK))
throw new VerificationException("One bulk is currently not supported on GraphComputer: " + step, traversal);
if (step instanceof PathProcessor && ((PathProcessor) step).getMaxRequirement() != PathProcessor.ElementRequirement.ID)
throw new VerificationException("It is not possible to access more than a path element's id on GraphComputer: " + step + " requires " + ((PathProcessor) step).getMaxRequirement(), traversal);
if (UNSUPPORTED_STEPS.stream().filter(c -> c.isAssignableFrom(step.getClass())).findFirst().isPresent())
throw new VerificationException("The following step is currently not supported on GraphComputer: " + step, traversal);
}
Step<?, ?> nextParentStep = traversal.getParent().asStep();
while (!(nextParentStep instanceof EmptyStep)) {
if (nextParentStep instanceof PathProcessor && ((PathProcessor) nextParentStep).getMaxRequirement() != PathProcessor.ElementRequirement.ID)
throw new VerificationException("The following path processor step requires more than the element id on GraphComputer: " + nextParentStep + " requires " + ((PathProcessor) nextParentStep).getMaxRequirement(), traversal);
nextParentStep = nextParentStep.getNextStep();
}
}
示例12: isOptimizable
import org.apache.tinkerpop.gremlin.process.traversal.Step; //导入方法依赖的package包/类
/**
* Checks whether a given step is optimizable or not.
*
* @param step the step to check
* @return <code>true</code> if the step is optimizable, otherwise <code>false</code>
*/
private static boolean isOptimizable(final Step step) {
return ((step instanceof VertexStep && ((VertexStep) step).returnsVertex()) ||
(step instanceof PropertiesStep && PropertyType.VALUE.equals(((PropertiesStep) step).getReturnType()))) && (step.getTraversal().getEndStep().getLabels().isEmpty() || step.getNextStep() instanceof CountGlobalStep);
}