本文整理匯總了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()));
}