@Override public void apply(Traversal.Admin<?, ?> traversal) { if (!TraversalHelper.onGraphComputer(traversal) || !TraversalHelper.isGlobalChild(traversal)) return; for (final Step<?, ?> step : traversal.getSteps()) { if (step instanceof GraphComputing) ((GraphComputing) step).onGraphComputer(); } }
@Override public void apply(final Traversal.Admin<?, ?> traversal) { if (!TraversalHelper.onGraphComputer(traversal)) return; 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); } // 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: " + traversal, traversal); // you can not traverse past the local star graph with localChildren (e.g. by()-modulators). if (!TraversalHelper.isGlobalChild(traversal) && !TraversalHelper.isLocalStarGraph(traversal)) throw new VerificationException("Local traversals may not traverse past the local star-graph on GraphComputer: " + traversal, traversal); for (final Step<?, ?> step : traversal.getSteps()) { 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(); } }
@Override public void apply(final Traversal.Admin<?, ?> traversal) { if (!TraversalHelper.onGraphComputer(traversal) || !TraversalHelper.isGlobalChild(traversal) ||
@Override public void apply(Traversal.Admin<?, ?> traversal) { if (!TraversalHelper.onGraphComputer(traversal) || !TraversalHelper.isGlobalChild(traversal)) return; for (final Step<?, ?> step : traversal.getSteps()) { if (step instanceof GraphComputing) ((GraphComputing) step).onGraphComputer(); } }
@Override public void apply(final Traversal.Admin<?, ?> traversal) { if (!TraversalHelper.onGraphComputer(traversal)) return; 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); } // 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: " + traversal, traversal); // you can not traverse past the local star graph with localChildren (e.g. by()-modulators). if (!TraversalHelper.isGlobalChild(traversal) && !TraversalHelper.isLocalStarGraph(traversal)) throw new VerificationException("Local traversals may not traverse past the local star-graph on GraphComputer: " + traversal, traversal); for (final Step<?, ?> step : traversal.getSteps()) { 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(); } }
@Override public void apply(final Traversal.Admin<?, ?> traversal) { if (!TraversalHelper.onGraphComputer(traversal) || !TraversalHelper.isGlobalChild(traversal) ||