本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep类的典型用法代码示例。如果您正苦于以下问题:Java SumGlobalStep类的具体用法?Java SumGlobalStep怎么用?Java SumGlobalStep使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SumGlobalStep类属于org.apache.tinkerpop.gremlin.process.traversal.step.map包,在下文中一共展示了SumGlobalStep类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isLegal
import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep; //导入依赖的package包/类
public static boolean isLegal(final Traversal.Admin<?, ?> traversal) {
final Step<?, ?> startStep = traversal.getStartStep();
final Step<?, ?> endStep = traversal.getEndStep();
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);
}
示例2: isLegal
import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep; //导入依赖的package包/类
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);
}
示例3: isLegal
import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep; //导入依赖的package包/类
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);
}
示例4: sum
import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep; //导入依赖的package包/类
public default <E2 extends Number> GraphTraversal<S, E2> sum(final Scope scope) {
return this.asAdmin().addStep(scope.equals(Scope.global) ? new SumGlobalStep<>(this.asAdmin()) : new SumLocalStep(this.asAdmin()));
}
示例5: sum
import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep; //导入依赖的package包/类
/**
* Map the traversal stream to its reduction as a sum of the {@link Traverser#get} values multiplied by their
* {@link Traverser#bulk} (i.e. sum the traverser values up to this point).
*
* @return the traversal with an appended {@link SumGlobalStep}.
* @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#sum-step" target="_blank">Reference Documentation - Sum Step</a>
* @since 3.0.0-incubating
*/
public default <E2 extends Number> GraphTraversal<S, E2> sum() {
this.asAdmin().getBytecode().addStep(Symbols.sum);
return this.asAdmin().addStep(new SumGlobalStep<>(this.asAdmin()));
}