TraversalHelper.isLocalStarGraph
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper.isLocalStarGraph(Showing top 13 results out of 315)

origin: org.apache.tinkerpop/gremlin-core

public static boolean isLocalStarGraph(final Traversal.Admin<?, ?> traversal) {
  return 'x' != isLocalStarGraph(traversal, 'v');
}
origin: org.apache.tinkerpop/spark-gremlin

  public static boolean isLegal(final Traversal.Admin<?, ?> traversal) {
    final Step<?, ?> startStep = traversal.getStartStep();
    final Step<?, ?> endStep = traversal.getEndStep();
    // right now this is not supported because of how the SparkStarBarrierInterceptor mutates the traversal prior to local evaluation
    if (traversal.getStrategies().toList().stream().filter(strategy -> strategy instanceof SubgraphStrategy).findAny().isPresent())
      return false;
    if (!startStep.getClass().equals(GraphStep.class) || ((GraphStep) startStep).returnsEdge())
      return false;
    if (!endStep.getClass().equals(CountGlobalStep.class) &&
        !endStep.getClass().equals(SumGlobalStep.class) &&
        !endStep.getClass().equals(MeanGlobalStep.class) &&
        !endStep.getClass().equals(MaxGlobalStep.class) &&
        !endStep.getClass().equals(MinGlobalStep.class) &&
        !endStep.getClass().equals(FoldStep.class) &&
        !endStep.getClass().equals(GroupStep.class) &&
        !endStep.getClass().equals(GroupCountStep.class))
      // TODO: tree()
      return false;
    if (TraversalHelper.getStepsOfAssignableClassRecursively(Scope.global, Barrier.class, traversal).size() != 1)
      return false;
    if (traversal.getTraverserRequirements().contains(TraverserRequirement.SACK))
      return false;
    return TraversalHelper.isLocalStarGraph(traversal);
  }
}
origin: apache/tinkerpop

@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();
  }
}
origin: org.apache.tinkerpop/gremlin-core

Set<Character> states = new HashSet<>();
for (final Traversal.Admin<?, ?> local : ((TraversalParent) step).getLocalChildren()) {
  final char s = isLocalStarGraph(local, currState);
  if ('x' == s) return 'x';
  states.add(s);
  final char s = isLocalStarGraph(local, currState);
  if ('x' == s) return 'x';
  states.add(s);
origin: org.apache.tinkerpop/gremlin-core

  !(computerTraversal.getStartStep().getNextStep() instanceof Barrier) &&
  TraversalHelper.hasStepOfAssignableClassRecursively(Arrays.asList(VertexStep.class, EdgeVertexStep.class), computerTraversal) &&
  TraversalHelper.isLocalStarGraph(computerTraversal)) {
final Step barrier = (Step) TraversalHelper.getFirstStepOfAssignableClass(Barrier.class, computerTraversal).orElse(null);
if (MessagePassingReductionStrategy.insertElementId(barrier)) // out().count() -> out().id().count()
origin: apache/tinkerpop

if (!TraversalHelper.isLocalStarGraph(edgeFilter.asAdmin()))
  throw GraphComputer.Exceptions.edgeFilterAccessesAdjacentVertices(edgeFilter);
this.edgeFilter = edgeFilter.asAdmin().clone();
origin: apache/tinkerpop

public static boolean isLocalStarGraph(final Traversal.Admin<?, ?> traversal) {
  return 'x' != isLocalStarGraph(traversal, 'v');
}
origin: apache/tinkerpop

  public static boolean isLegal(final Traversal.Admin<?, ?> traversal) {
    final Step<?, ?> startStep = traversal.getStartStep();
    final Step<?, ?> endStep = traversal.getEndStep();
    // right now this is not supported because of how the SparkStarBarrierInterceptor mutates the traversal prior to local evaluation
    if (traversal.getStrategies().toList().stream().filter(strategy -> strategy instanceof SubgraphStrategy).findAny().isPresent())
      return false;
    if (!startStep.getClass().equals(GraphStep.class) || ((GraphStep) startStep).returnsEdge())
      return false;
    if (!endStep.getClass().equals(CountGlobalStep.class) &&
        !endStep.getClass().equals(SumGlobalStep.class) &&
        !endStep.getClass().equals(MeanGlobalStep.class) &&
        !endStep.getClass().equals(MaxGlobalStep.class) &&
        !endStep.getClass().equals(MinGlobalStep.class) &&
        !endStep.getClass().equals(FoldStep.class) &&
        !endStep.getClass().equals(GroupStep.class) &&
        !endStep.getClass().equals(GroupCountStep.class))
      // TODO: tree()
      return false;
    if (TraversalHelper.getStepsOfAssignableClassRecursively(Scope.global, Barrier.class, traversal).size() != 1)
      return false;
    if (traversal.getTraverserRequirements().contains(TraverserRequirement.SACK))
      return false;
    return TraversalHelper.isLocalStarGraph(traversal);
  }
}
origin: org.apache.tinkerpop/spark-gremlin

  public static boolean isLegal(final Traversal.Admin<?, ?> traversal) {
    final Step<?, ?> startStep = traversal.getStartStep();
    final Step<?, ?> endStep = traversal.getEndStep();
    // right now this is not supported because of how the SparkStarBarrierInterceptor mutates the traversal prior to local evaluation
    if (traversal.getStrategies().toList().stream().filter(strategy -> strategy instanceof SubgraphStrategy).findAny().isPresent())
      return false;
    if (!startStep.getClass().equals(GraphStep.class) || ((GraphStep) startStep).returnsEdge())
      return false;
    if (!endStep.getClass().equals(CountGlobalStep.class) &&
        !endStep.getClass().equals(SumGlobalStep.class) &&
        !endStep.getClass().equals(MeanGlobalStep.class) &&
        !endStep.getClass().equals(MaxGlobalStep.class) &&
        !endStep.getClass().equals(MinGlobalStep.class) &&
        !endStep.getClass().equals(FoldStep.class) &&
        !endStep.getClass().equals(GroupStep.class) &&
        !endStep.getClass().equals(GroupCountStep.class))
      // TODO: tree()
      return false;
    if (TraversalHelper.getStepsOfAssignableClassRecursively(Scope.global, Barrier.class, traversal).size() != 1)
      return false;
    if (traversal.getTraverserRequirements().contains(TraverserRequirement.SACK))
      return false;
    return TraversalHelper.isLocalStarGraph(traversal);
  }
}
origin: org.apache.tinkerpop/gremlin-core

@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();
  }
}
origin: apache/tinkerpop

Set<Character> states = new HashSet<>();
for (final Traversal.Admin<?, ?> local : ((TraversalParent) step).getLocalChildren()) {
  final char s = isLocalStarGraph(local, currState);
  if ('x' == s) return 'x';
  states.add(s);
  final char s = isLocalStarGraph(local, currState);
  if ('x' == s) return 'x';
  states.add(s);
origin: org.apache.tinkerpop/gremlin-core

if (!TraversalHelper.isLocalStarGraph(edgeFilter.asAdmin()))
  throw GraphComputer.Exceptions.edgeFilterAccessesAdjacentVertices(edgeFilter);
this.edgeFilter = edgeFilter.asAdmin().clone();
origin: org.apache.tinkerpop/gremlin-core

if (!TraversalHelper.isLocalStarGraph(edgeFilter.asAdmin()))
  throw GraphComputer.Exceptions.edgeFilterAccessesAdjacentVertices(edgeFilter);
this.edgeFilter = edgeFilter.asAdmin().clone();
org.apache.tinkerpop.gremlin.process.traversal.utilTraversalHelperisLocalStarGraph

Popular methods of TraversalHelper

  • getStepsOfClass
  • replaceStep
    Replace a step with a new step.
  • getLastStepOfAssignableClass
  • onGraphComputer
  • copyLabels
  • getRootTraversal
  • getStepsOfAssignableClassRecursively
  • anyStepRecursively
    Determine if any child step of a TraversalParent match the step given the provided Predicate.
  • getStepsOfAssignableClass
  • hasStepOfAssignableClassRecursively
    Determine if the traversal has any of the supplied steps of an assignable class in the current Trave
  • insertAfterStep
    Insert a step after a specified step instance.
  • removeAllSteps
  • insertAfterStep,
  • removeAllSteps,
  • getFirstStepOfAssignableClass,
  • getVariableLocations,
  • hasStepOfAssignableClass,
  • insertBeforeStep,
  • removeToTraversal,
  • addHasContainer,
  • addToCollection

Popular classes and methods

  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setScale (BigDecimal)
    Returns a new BigDecimal instance with the specified scale. If the new scale is greater than the old
  • getExternalFilesDir (Context)
  • Container (java.awt)
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • ArrayList (java.util)
    Resizable-array implementation of the List interface.
  • TimeZone (java.util)
    TimeZone represents a time zone, primarily used for configuring a Calendar or java.text.SimpleDateF
  • JTable (javax.swing)

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)