• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TraversalFilterStep类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep的典型用法代码示例。如果您正苦于以下问题:Java TraversalFilterStep类的具体用法?Java TraversalFilterStep怎么用?Java TraversalFilterStep使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TraversalFilterStep类属于org.apache.tinkerpop.gremlin.process.traversal.step.filter包,在下文中一共展示了TraversalFilterStep类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: apply

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
    final List<Step> steps = traversal.getSteps();
    final int size = steps.size() - 1;
    Step prev = null;
    for (int i = 0; i <= size; i++) {
        final Step curr = steps.get(i);
        if (i == size && isOptimizable(curr)) {
            final TraversalParent parent = curr.getTraversal().getParent();
            if (parent instanceof NotStep || parent instanceof TraversalFilterStep || parent instanceof WhereTraversalStep || parent instanceof ConnectiveStep) {
                optimizeStep(traversal, curr);
            }
        } else if (isOptimizable(prev)) {
            if (curr instanceof CountGlobalStep) {
                optimizeStep(traversal, prev);
            }
        }
        if (!(curr instanceof RangeGlobalStep)) {
            prev = curr;
        }
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:23,代码来源:AdjacentToIncidentStrategy.java


示例2: SubgraphStrategy

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
private SubgraphStrategy(final Traversal<Vertex, ?> vertexCriterion, final Traversal<Edge, ?> edgeCriterion) {
    this.vertexCriterion = vertexCriterion;

    // if there is no vertex predicate there is no need to test either side of the edge
    if (null == vertexCriterion) {
        this.edgeCriterion = edgeCriterion;
    } else {
        final Traversal<Object, Vertex> inVertexPredicate = __.inV().filter(vertexCriterion);
        final Traversal<Object, Vertex> outVertexPredicate = __.outV().filter(vertexCriterion);

        // if there is a vertex predicate then there is an implied edge filter on vertices even if there is no
        // edge predicate provided by the user.
        if (null == edgeCriterion)
            this.edgeCriterion = __.and(inVertexPredicate.asAdmin(), outVertexPredicate.asAdmin());
        else
            this.edgeCriterion = edgeCriterion.asAdmin().addStep(new TraversalFilterStep<>(edgeCriterion.asAdmin(), __.and(inVertexPredicate.asAdmin(), outVertexPredicate.asAdmin())));
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:19,代码来源:SubgraphStrategy.java


示例3: shouldIdentifyLocalChildren

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Test
public void shouldIdentifyLocalChildren() {
    final Traversal.Admin<?, ?> localChild = __.as("x").select("a", "b").by("name").asAdmin();
    new LocalStep<>(new DefaultTraversal(), localChild);
    assertFalse(TraversalHelper.isGlobalChild(localChild));
    ///
    new WhereTraversalStep<>(new DefaultTraversal(), localChild);
    assertFalse(TraversalHelper.isGlobalChild(localChild));
    ///
    new TraversalFilterStep<>(new DefaultTraversal(), localChild);
    assertFalse(TraversalHelper.isGlobalChild(localChild));
    ///
    new TraversalMapStep<>(new DefaultTraversal(), localChild);
    assertFalse(TraversalHelper.isGlobalChild(localChild));
    ///
    new TraversalFlatMapStep<>(new DefaultTraversal(), localChild);
    assertFalse(TraversalHelper.isGlobalChild(localChild));
    ///
    final Traversal.Admin<?, ?> remoteLocalChild = __.repeat(localChild).asAdmin();
    new LocalStep<>(new DefaultTraversal<>(), remoteLocalChild);
    assertFalse(TraversalHelper.isGlobalChild(localChild));
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:23,代码来源:TraversalHelperTest.java


示例4: apply

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
    boolean changed = true; // recursively walk child traversals trying to inline them into the current traversal line.
    while (changed) {
        changed = false;
        final Iterator<FilterStep> filterStepIterator = TraversalHelper.getStepsOfAssignableClass(FilterStep.class, traversal).iterator();
        while (!changed && filterStepIterator.hasNext()) {
            final FilterStep<?> step = filterStepIterator.next();
            changed = step instanceof HasStep && InlineFilterStrategy.processHasStep((HasStep) step, traversal) ||
                    step instanceof TraversalFilterStep && InlineFilterStrategy.processTraversalFilterStep((TraversalFilterStep) step, traversal) ||
                    step instanceof OrStep && InlineFilterStrategy.processOrStep((OrStep) step, traversal) ||
                    step instanceof AndStep && InlineFilterStrategy.processAndStep((AndStep) step, traversal);
        }
        if (!changed && traversal.getParent() instanceof EmptyStep) {
            final Iterator<MatchStep> matchStepIterator = TraversalHelper.getStepsOfClass(MatchStep.class, traversal).iterator();
            while (!changed && matchStepIterator.hasNext()) {
                if (InlineFilterStrategy.processMatchStep(matchStepIterator.next(), traversal))
                    changed = true;
            }
        }
    }
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:23,代码来源:InlineFilterStrategy.java


示例5: processTraversalFilterStep

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
private static final boolean processTraversalFilterStep(final TraversalFilterStep<?> step, final Traversal.Admin<?, ?> traversal) {
    final Traversal.Admin<?, ?> childTraversal = step.getLocalChildren().get(0);
    if (TraversalHelper.hasAllStepsOfClass(childTraversal, FilterStep.class) &&
            !TraversalHelper.hasStepOfClass(childTraversal,
                    DropStep.class,
                    RangeGlobalStep.class,
                    DedupGlobalStep.class,
                    LambdaHolder.class)) {
        TraversalHelper.applySingleLevelStrategies(traversal, childTraversal, InlineFilterStrategy.class);
        final Step<?, ?> finalStep = childTraversal.getEndStep();
        TraversalHelper.insertTraversal((Step) step, childTraversal, traversal);
        TraversalHelper.copyLabels(step, finalStep, false);
        traversal.removeStep(step);
        return true;
    }
    return false;
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:18,代码来源:InlineFilterStrategy.java


示例6: shouldNotRetainMarkers

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Test
public void shouldNotRetainMarkers() {
    final SubgraphStrategy strategy = SubgraphStrategy.build().vertices(__.<Vertex>out().hasLabel("person")).create();
    final Traversal.Admin<?, ?> t = out().inE().asAdmin();
    t.setStrategies(t.getStrategies().clone().addStrategies(strategy, StandardVerificationStrategy.instance()));
    t.applyStrategies();
    assertEquals(t.getSteps().get(0).getClass(), VertexStep.class);
    assertEquals(t.getSteps().get(1).getClass(), TraversalFilterStep.class);
    assertEquals(AndStep.class, ((TraversalFilterStep<?>) t.getSteps().get(1)).getLocalChildren().get(0).getStartStep().getClass());
    assertEquals(0, ((TraversalFilterStep<?>) t.getSteps().get(1)).getLocalChildren().get(0).getStartStep().getLabels().size());
    assertEquals(t.getSteps().get(2).getClass(), EdgeVertexStep.class);
    assertEquals(t.getSteps().get(3).getClass(), TraversalFilterStep.class);
    assertEquals(VertexStep.class, ((TraversalFilterStep<?>) t.getSteps().get(3)).getLocalChildren().get(0).getStartStep().getClass());
    assertEquals(0, ((TraversalFilterStep<?>) t.getSteps().get(3)).getLocalChildren().get(0).getStartStep().getLabels().size());
    TraversalHelper.getStepsOfAssignableClassRecursively(Step.class, t).forEach(step -> assertTrue(step.getLabels().isEmpty()));
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:17,代码来源:SubgraphStrategyTest.java


示例7: apply

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Override
public void apply(Traversal.Admin<?, ?> traversal) {

    // Retrieve all graph (`V()`) steps - this is the step the strategy should replace
    List<GraphStep> graphSteps = TraversalHelper.getStepsOfAssignableClass(GraphStep.class, traversal);

    for (GraphStep graphStep : graphSteps) {
        // For each graph step, confirm it follows this pattern:
        // `V().filter(__.properties(a).where(P.eq(b)))`

        if (!(graphStep.getNextStep() instanceof TraversalFilterStep)) continue;
        TraversalFilterStep<Vertex> filterStep = (TraversalFilterStep<Vertex>) graphStep.getNextStep();

        // Retrieve the filter steps e.g. `__.properties(a).where(P.eq(b))`
        List<Step> steps = stepsFromFilterStep(filterStep);

        if (steps.size() < 2) continue;
        Step propertiesStep = steps.get(0); // This is `properties(a)`
        Step whereStep = steps.get(1);      // This is `filter(__.where(P.eq(b)))`

        // Get the property key `a`
        if (!(propertiesStep instanceof PropertiesStep)) continue;
        Optional<String> propertyKey = propertyFromPropertiesStep((PropertiesStep<Vertex>) propertiesStep);
        if (!propertyKey.isPresent()) continue;

        // Get the step label `b`
        if (!(whereStep instanceof WherePredicateStep)) continue;
        Optional<String> label = labelFromWhereEqPredicate((WherePredicateStep<Vertex>) whereStep);
        if (!label.isPresent()) continue;

        executeStrategy(traversal, graphStep, filterStep, propertyKey.get(), label.get());
    }
}
 
开发者ID:graknlabs,项目名称:grakn,代码行数:34,代码来源:JanusPreviousPropertyStepStrategy.java


示例8: executeStrategy

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
/**
 * Replace the {@code graphStep} and {@code filterStep} with a new {@link JanusPreviousPropertyStep} in the given
 * {@code traversal}.
 */
private void executeStrategy(
        Traversal.Admin<?, ?> traversal, GraphStep<?, ?> graphStep, TraversalFilterStep<Vertex> filterStep,
        String propertyKey, String label) {

    JanusPreviousPropertyStep newStep = new JanusPreviousPropertyStep(traversal, propertyKey, label);
    traversal.removeStep(filterStep);
    TraversalHelper.replaceStep(graphStep, newStep, traversal);
}
 
开发者ID:graknlabs,项目名称:grakn,代码行数:13,代码来源:JanusPreviousPropertyStepStrategy.java


示例9: applyCriterion

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
private void applyCriterion(final List<Step> stepsToApplyCriterionAfter, final Traversal.Admin traversal,
                            final Traversal.Admin<? extends Element, ?> criterion) {
    stepsToApplyCriterionAfter.forEach(s -> {
        // re-assign the step label to the criterion because the label should apply seamlessly after the filter
        final Step filter = new TraversalFilterStep<>(traversal, criterion.clone());
        transferLabels(s, filter);
        TraversalHelper.insertAfterStep(filter, s, traversal);
    });
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:10,代码来源:SubgraphStrategy.java


示例10: shouldAddFilterAfterVertex

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Test
public void shouldAddFilterAfterVertex() {
    final SubgraphStrategy strategy = SubgraphStrategy.build().vertexCriterion(__.identity()).create();
    final Traversal t = __.inV();
    strategy.apply(t.asAdmin());
    final EdgeVertexStep edgeVertexStep = (EdgeVertexStep) t.asAdmin().getStartStep();
    assertEquals(TraversalFilterStep.class, edgeVertexStep.getNextStep().getClass());
    final TraversalFilterStep h = (TraversalFilterStep) t.asAdmin().getEndStep();
    assertEquals(1, h.getLocalChildren().size());
    assertThat(((DefaultGraphTraversal) h.getLocalChildren().get(0)).getEndStep(), CoreMatchers.instanceOf(IdentityStep.class));
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:12,代码来源:SubgraphStrategyTest.java


示例11: shouldAddFilterAfterEdge

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Test
public void shouldAddFilterAfterEdge() {
    final SubgraphStrategy strategy = SubgraphStrategy.build().edgeCriterion(__.identity()).create();
    final Traversal t = __.inE();
    strategy.apply(t.asAdmin());
    final VertexStep vertexStep = (VertexStep) t.asAdmin().getStartStep();
    assertEquals(TraversalFilterStep.class, vertexStep.getNextStep().getClass());
    final TraversalFilterStep h = (TraversalFilterStep) t.asAdmin().getEndStep();
    assertEquals(1, h.getLocalChildren().size());
    assertThat(((DefaultGraphTraversal) h.getLocalChildren().get(0)).getEndStep(), CoreMatchers.instanceOf(IdentityStep.class));
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:12,代码来源:SubgraphStrategyTest.java


示例12: shouldAddBothFiltersAfterVertex

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Test
public void shouldAddBothFiltersAfterVertex() {
    final SubgraphStrategy strategy = SubgraphStrategy.build().edgeCriterion(__.identity()).vertexCriterion(__.identity()).create();
    final Traversal t = __.inE();
    strategy.apply(t.asAdmin());
    final VertexStep vertexStep = (VertexStep) t.asAdmin().getStartStep();
    assertEquals(TraversalFilterStep.class, vertexStep.getNextStep().getClass());
    final TraversalFilterStep h = (TraversalFilterStep) t.asAdmin().getEndStep();
    assertEquals(1, h.getLocalChildren().size());
    assertThat(((DefaultGraphTraversal) h.getLocalChildren().get(0)).getEndStep(), CoreMatchers.instanceOf(TraversalFilterStep.class));
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:12,代码来源:SubgraphStrategyTest.java


示例13: shouldSubgraph

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Test
public void shouldSubgraph() {
    final SubgraphStrategy strategy = SubgraphStrategy.build().edgeCriterion(__.identity()).vertexCriterion(__.identity()).create();
    strategy.apply(traversal.asAdmin());

    final List<TraversalFilterStep> steps = TraversalHelper.getStepsOfClass(TraversalFilterStep.class, traversal.asAdmin());
    assertEquals(expectedInsertedSteps, steps.size());
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:9,代码来源:SubgraphStrategyTraverseTest.java


示例14: getStepRank

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
/**
 * Ranks the given step. Steps with lower ranks can be moved in front of steps with higher ranks. 0 means that
 * the step has no rank and thus is not exchangeable with its neighbors.
 *
 * @param step the step to get a ranking for
 * @return The rank of the given step.
 */
private static int getStepRank(final Step step) {
    final int rank;
    if (!(step instanceof FilterStep || step instanceof OrderGlobalStep))
        return 0;
    else if (step instanceof IsStep || step instanceof ClassFilterStep)
        rank = 1;
    else if (step instanceof HasStep)
        rank = 2;
    else if (step instanceof WherePredicateStep && ((WherePredicateStep) step).getLocalChildren().isEmpty())
        rank = 3;
    else if (step instanceof TraversalFilterStep || step instanceof NotStep)
        rank = 4;
    else if (step instanceof WhereTraversalStep)
        rank = 5;
    else if (step instanceof OrStep)
        rank = 6;
    else if (step instanceof AndStep)
        rank = 7;
    else if (step instanceof WherePredicateStep) // has by()-modulation
        rank = 8;
    else if (step instanceof DedupGlobalStep)
        rank = 9;
    else if (step instanceof OrderGlobalStep)
        rank = 10;
    else
        return 0;
    ////////////
    if (step instanceof TraversalParent)
        return getMaxStepRank((TraversalParent) step, rank);
    else
        return rank;
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:40,代码来源:FilterRankingStrategy.java


示例15: SubgraphStrategy

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
private SubgraphStrategy(final Traversal<Vertex, ?> vertexCriterion, final Traversal<Edge, ?> edgeCriterion, final Traversal<VertexProperty, ?> vertexPropertyCriterion) {

        this.vertexCriterion = null == vertexCriterion ? null : vertexCriterion.asAdmin().clone();

        // if there is no vertex predicate there is no need to test either side of the edge
        if (null == this.vertexCriterion) {
            this.edgeCriterion = null == edgeCriterion ? null : edgeCriterion.asAdmin().clone();
        } else {
            final Traversal.Admin<Edge, ?> vertexPredicate;
            vertexPredicate = __.<Edge>and(
                    __.inV().filter(this.vertexCriterion),
                    __.outV().filter(this.vertexCriterion)).asAdmin();

            // if there is a vertex predicate then there is an implied edge filter on vertices even if there is no
            // edge predicate provided by the user.
            this.edgeCriterion = null == edgeCriterion ?
                    vertexPredicate :
                    edgeCriterion.asAdmin().clone().addStep(new TraversalFilterStep<>(edgeCriterion.asAdmin(), vertexPredicate));
        }

        this.vertexPropertyCriterion = null == vertexPropertyCriterion ? null : vertexPropertyCriterion.asAdmin().clone();

        if (null != this.vertexCriterion)
            TraversalHelper.applyTraversalRecursively(t -> t.getStartStep().addLabel(MARKER), this.vertexCriterion);
        if (null != this.edgeCriterion)
            TraversalHelper.applyTraversalRecursively(t -> t.getStartStep().addLabel(MARKER), this.edgeCriterion);
        if (null != this.vertexPropertyCriterion)
            TraversalHelper.applyTraversalRecursively(t -> t.getStartStep().addLabel(MARKER), this.vertexPropertyCriterion);
    }
 
开发者ID:apache,项目名称:tinkerpop,代码行数:30,代码来源:SubgraphStrategy.java


示例16: applyCriterion

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
private static void applyCriterion(final List<Step> stepsToApplyCriterionAfter, final Traversal.Admin traversal,
                                   final Traversal.Admin<? extends Element, ?> criterion) {
    for (final Step<?, ?> step : stepsToApplyCriterionAfter) {
        // re-assign the step label to the criterion because the label should apply seamlessly after the filter
        final Step filter = new TraversalFilterStep<>(traversal, criterion.clone());
        TraversalHelper.insertAfterStep(filter, step, traversal);
        TraversalHelper.copyLabels(step, filter, true);
    }
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:10,代码来源:SubgraphStrategy.java


示例17: shouldAddFilterAfterVertex

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Test
public void shouldAddFilterAfterVertex() {
    final SubgraphStrategy strategy = SubgraphStrategy.build().vertices(__.identity()).create();
    final Traversal t = __.inV();
    strategy.apply(t.asAdmin());
    final EdgeVertexStep edgeVertexStep = (EdgeVertexStep) t.asAdmin().getStartStep();
    assertEquals(TraversalFilterStep.class, edgeVertexStep.getNextStep().getClass());
    final TraversalFilterStep h = (TraversalFilterStep) t.asAdmin().getEndStep();
    assertEquals(1, h.getLocalChildren().size());
    assertThat(((DefaultGraphTraversal) h.getLocalChildren().get(0)).getEndStep(), CoreMatchers.instanceOf(IdentityStep.class));
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:12,代码来源:SubgraphStrategyTest.java


示例18: shouldAddFilterAfterEdge

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Test
public void shouldAddFilterAfterEdge() {
    final SubgraphStrategy strategy = SubgraphStrategy.build().edges(__.identity()).create();
    final Traversal t = __.inE();
    strategy.apply(t.asAdmin());
    final VertexStep vertexStep = (VertexStep) t.asAdmin().getStartStep();
    assertEquals(TraversalFilterStep.class, vertexStep.getNextStep().getClass());
    final TraversalFilterStep h = (TraversalFilterStep) t.asAdmin().getEndStep();
    assertEquals(1, h.getLocalChildren().size());
    assertThat(((DefaultGraphTraversal) h.getLocalChildren().get(0)).getEndStep(), CoreMatchers.instanceOf(IdentityStep.class));
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:12,代码来源:SubgraphStrategyTest.java


示例19: shouldAddBothFiltersAfterVertex

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Test
public void shouldAddBothFiltersAfterVertex() {
    final SubgraphStrategy strategy = SubgraphStrategy.build().edges(__.identity()).vertices(__.identity()).create();
    final Traversal t = __.inE();
    strategy.apply(t.asAdmin());
    final VertexStep vertexStep = (VertexStep) t.asAdmin().getStartStep();
    assertEquals(TraversalFilterStep.class, vertexStep.getNextStep().getClass());
    final TraversalFilterStep h = (TraversalFilterStep) t.asAdmin().getEndStep();
    assertEquals(1, h.getLocalChildren().size());
    assertThat(((DefaultGraphTraversal) h.getLocalChildren().get(0)).getEndStep(), CoreMatchers.instanceOf(TraversalFilterStep.class));
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:12,代码来源:SubgraphStrategyTest.java


示例20: apply

import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; //导入依赖的package包/类
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
    //Only optimize SqlgGraph. StarGraph also passes through here.
    //noinspection OptionalGetWithoutIsPresent
    if (!(traversal.getGraph().get() instanceof SqlgGraph)) {
        return;
    }
    List<TraversalFilterStep> traversalFilterSteps = TraversalHelper.getStepsOfAssignableClass(TraversalFilterStep.class, traversal);
    for (TraversalFilterStep<S> traversalFilterStep : traversalFilterSteps) {

        List<Traversal.Admin<S, ?>> filterTraversals = traversalFilterStep.getLocalChildren();
        Preconditions.checkState(filterTraversals.size() == 1);
        Traversal.Admin<S, ?> filterTraversal = filterTraversals.get(0);

        //reducing barrier steps like count does not work with Sqlg's barrier optimizations
        List<ReducingBarrierStep> reducingBarrierSteps = TraversalHelper.getStepsOfAssignableClassRecursively(ReducingBarrierStep.class, filterTraversal);
        if (!reducingBarrierSteps.isEmpty()) {
            continue;
        }

        SqlgTraversalFilterStepBarrier sqlgTraversalFilterStepBarrier = new SqlgTraversalFilterStepBarrier<>(
                traversal,
                filterTraversal
        );
        for (String label : traversalFilterStep.getLabels()) {
            sqlgTraversalFilterStepBarrier.addLabel(label);
        }
        TraversalHelper.replaceStep(
                traversalFilterStep,
                sqlgTraversalFilterStepBarrier,
                traversalFilterStep.getTraversal()
        );
    }
}
 
开发者ID:pietermartin,项目名称:sqlg,代码行数:35,代码来源:SqlgTraversalFilterStepStrategy.java



注:本文中的org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Durations类代码示例发布时间:2022-05-23
下一篇:
Java Token类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap