当前位置: 首页>>代码示例>>Java>>正文


Java IgnoreEngine类代码示例

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


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

示例1: g_V_asXaX_out_mapXa_nameX

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.COMPUTER)
public void g_V_asXaX_out_mapXa_nameX() {
    int marko = 0;
    int peter = 0;
    int josh = 0;
    int other = 0;

    final Traversal<Vertex, String> traversal = get_g_withPath_V_asXaX_out_mapXa_nameX();
    printTraversalForm(traversal);
    while (traversal.hasNext()) {
        final String name = traversal.next();
        if (name.equals("marko")) marko++;
        else if (name.equals("peter")) peter++;
        else if (name.equals("josh")) josh++;
        else other++;
    }
    assertEquals(marko, 3);
    assertEquals(josh, 2);
    assertEquals(peter, 1);
    assertEquals(other, 0);
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:24,代码来源:MapTest.java

示例2: shouldFilterVertexCriterionAndKeepLabels

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.COMPUTER)
public void shouldFilterVertexCriterionAndKeepLabels() throws Exception {
    // this will exclude "peter"
    final Traversal<Vertex, ?> vertexCriterion = __.has("name", P.within("ripple", "josh", "marko"));

    final SubgraphStrategy strategy = SubgraphStrategy.build().vertexCriterion(vertexCriterion).create();
    final GraphTraversalSource sg = create(strategy);

    assertEquals(9, g.V().as("a").out().in().as("b").dedup("a", "b").count().next().intValue());
    assertEquals(2, sg.V().as("a").out().in().as("b").dedup("a", "b").count().next().intValue());

    final List<Object> list = sg.V().as("a").out().in().as("b").dedup("a", "b").values("name").toList();
    assertThat(list, hasItems("marko", "josh"));
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:17,代码来源:SubgraphStrategyProcessTest.java

示例3: g_withPath_V_asXaX_out_mapXa_nameX

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.COMPUTER)
public void g_withPath_V_asXaX_out_mapXa_nameX() {
    int marko = 0;
    int peter = 0;
    int josh = 0;
    int other = 0;

    final Traversal<Vertex, String> traversal = get_g_withPath_V_asXaX_out_mapXa_nameX();
    printTraversalForm(traversal);
    while (traversal.hasNext()) {
        final String name = traversal.next();
        if (name.equals("marko")) marko++;
        else if (name.equals("peter")) peter++;
        else if (name.equals("josh")) josh++;
        else other++;
    }
    assertEquals(marko, 3);
    assertEquals(josh, 2);
    assertEquals(peter, 1);
    assertEquals(other, 0);
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:24,代码来源:MapTest.java

示例4: g_V_asXaX_out_out_mapXa_name_it_nameX

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.COMPUTER)
public void g_V_asXaX_out_out_mapXa_name_it_nameX() {
    final Traversal<Vertex, String> traversal = get_g_withPath_V_asXaX_out_out_mapXa_name_it_nameX();
    int counter = 0;
    while (traversal.hasNext()) {
        counter++;
        final String doubleName = traversal.next();
        assertTrue("markoripple".equals(doubleName) || "markolop".equals(doubleName));
    }
    assertEquals(2, counter);
    assertFalse(traversal.hasNext());
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:15,代码来源:MapTest.java

示例5: g_VX1_2_3_4X_name

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_REMOVE_VERTICES)
@IgnoreEngine(TraversalEngine.Type.COMPUTER)
public void g_VX1_2_3_4X_name() {
    final Traversal<Vertex, String> traversal = get_g_VX1_2_3_4X_name(convertToVertexId("marko"), convertToVertexId("vadas"), convertToVertexId("lop"), convertToVertexId("josh"));
    printTraversalForm(traversal);
    checkResults(Arrays.asList("marko", "vadas", "josh"), traversal);
    assertFalse(traversal.hasNext());
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:11,代码来源:VertexTest.java

示例6: g_V_both_hasLabelXpersonX_order_byXage_decrX_name

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@IgnoreEngine(TraversalEngine.Type.STANDARD) // validating the internal sort/limit works in GraphComputer
@LoadGraphWith(MODERN)
public void g_V_both_hasLabelXpersonX_order_byXage_decrX_name() {
    final Traversal<Vertex, String> traversal = get_g_V_both_hasLabelXpersonX_order_byXage_decrX_name();
    traversal.asAdmin().applyStrategies();
    if (!TraversalHelper.getFirstStepOfAssignableClass(OrderGlobalStep.class, traversal.asAdmin()).isPresent())
        return; // total hack to avoid providers that don't compile to OrderGlobalStep
    TraversalHelper.getFirstStepOfAssignableClass(OrderGlobalStep.class, traversal.asAdmin()).get().setLimit(1);
    printTraversalForm(traversal);
    final List<String> results = traversal.toList();
    assertTrue(results.size() < 8);
    assertFalse(traversal.hasNext());
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:15,代码来源:OrderTest.java

示例7: g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profile

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.COMPUTER)
public void g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profile() {
    final Traversal<Vertex, TraversalMetrics> traversal = get_g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profile();
    printTraversalForm(traversal);
    TraversalMetrics traversalMetrics = traversal.next();
    assertEquals("There should be 8 steps in this traversal (counting injected profile steps).", 8, traversal.asAdmin().getSteps().size());
    validate_g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profile(traversalMetrics);
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:11,代码来源:ProfileTest.java

示例8: g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profileXmetricsX

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.COMPUTER)
public void g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profileXmetricsX() {
    final Traversal<Vertex, Vertex> traversal = get_g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profileXmetricsX();
    printTraversalForm(traversal);
    traversal.iterate();
    assertEquals("There should be 7 steps in this traversal (counting injected profile steps).", 7, traversal.asAdmin().getSteps().size());
    TraversalMetrics traversalMetrics = traversal.asAdmin().getSideEffects().<TraversalMetrics>get(METRICS_KEY);
    validate_g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profile(traversalMetrics);
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:12,代码来源:ProfileTest.java

示例9: g_V_hasLabelXpersonX_pageRank_byXrankX_byXbothEX_rank_profile

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.STANDARD)
public void g_V_hasLabelXpersonX_pageRank_byXrankX_byXbothEX_rank_profile() {
    final Traversal<Vertex, TraversalMetrics> traversal = get_g_V_hasLabelXpersonX_pageRank_byXrankX_byXbothEX_rank_profile();
    //printTraversalForm(traversal);
    try {
        traversal.iterate();
        fail("Should have tossed an exception because multi-OLAP is unsolvable");
    } catch (Exception ex) {
        assertTrue(ex instanceof VerificationException || ExceptionUtils.getRootCause(ex) instanceof VerificationException);
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:14,代码来源:ProfileTest.java

示例10: g_VX1X_sideEffectXstore_aX_name

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.COMPUTER)
public void g_VX1X_sideEffectXstore_aX_name() {
    final Traversal<Vertex, String> traversal = get_g_VX1X_sideEffectXstore_aX_name(convertToVertexId("marko"));
    printTraversalForm(traversal);
    assertEquals(traversal.next(), "marko");
    assertFalse(traversal.hasNext());
    assertEquals(convertToVertexId("marko"), traversal.asAdmin().getSideEffects().<List<Vertex>>get("a").get(0).id());
    checkSideEffects(traversal.asAdmin().getSideEffects(), "a", ArrayList.class);
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:12,代码来源:SideEffectTest.java

示例11: g_VX1X_out_sideEffectXincr_cX_name

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.COMPUTER)
public void g_VX1X_out_sideEffectXincr_cX_name() {
    final Traversal<Vertex, String> traversal = get_g_VX1X_out_sideEffectXincr_cX_name(convertToVertexId("marko"));
    printTraversalForm(traversal);
    assert_g_v1_out_sideEffectXincr_cX_valueXnameX(traversal);
    assertEquals(new Integer(3), traversal.asAdmin().getSideEffects().<List<Integer>>get("c").get(0));
    checkSideEffects(traversal.asAdmin().getSideEffects(), "c", ArrayList.class);
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:11,代码来源:SideEffectTest.java

示例12: g_V_outE_identity_inV_explain

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.COMPUTER)
public void g_V_outE_identity_inV_explain() {
    final TraversalExplanation explanation = get_g_V_outE_identity_inV_explain();
    if (explanation.getStrategyTraversals().stream().map(Pair::getValue0).filter(s -> s instanceof IdentityRemovalStrategy || s instanceof IncidentToAdjacentStrategy).count() == 2) {
        printTraversalForm(explanation.getOriginalTraversal());
        boolean beforeIncident = true;
        boolean beforeIdentity = true;
        for (final Pair<TraversalStrategy, Traversal.Admin<?, ?>> pair : explanation.getStrategyTraversals()) {
            if (pair.getValue0().getClass().equals(IncidentToAdjacentStrategy.class))
                beforeIncident = false;
            if (pair.getValue0().getClass().equals(IdentityRemovalStrategy.class))
                beforeIdentity = false;

            if (beforeIdentity)
                assertEquals(1, TraversalHelper.getStepsOfClass(IdentityStep.class, pair.getValue1()).size());

            if (beforeIncident)
                assertEquals(1, TraversalHelper.getStepsOfClass(EdgeVertexStep.class, pair.getValue1()).size());

            if (!beforeIdentity)
                assertEquals(0, TraversalHelper.getStepsOfClass(IdentityStep.class, pair.getValue1()).size());

            if (!beforeIncident)
                assertEquals(0, TraversalHelper.getStepsOfClass(EdgeVertexStep.class, pair.getValue1()).size());
        }
        assertFalse(beforeIncident);
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:31,代码来源:ExplainTest.java

示例13: g_V_hasId_compilationEquality

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.COMPUTER) // only validate for OLTP
public void g_V_hasId_compilationEquality() {
    final Traversal<Vertex, Vertex> traversala1 = get_g_VX1X(convertToVertexId("marko"));
    final Traversal<Vertex, Vertex> traversala2 = get_g_V_hasIdX1X(convertToVertexId("marko"));
    final Traversal<Vertex, Vertex> traversalb1 = get_g_VX1_2X(convertToVertexId("marko"), convertToVertexId("vadas"));
    final Traversal<Vertex, Vertex> traversalb2 = get_g_V_hasIdX1_2X(convertToVertexId("marko"), convertToVertexId("vadas"));
    printTraversalForm(traversala1);
    printTraversalForm(traversala2);
    printTraversalForm(traversalb1);
    printTraversalForm(traversalb2);
    checkResults(Collections.singletonList(convertToVertex(graph, "marko")), traversala1);
    checkResults(Collections.singletonList(convertToVertex(graph, "marko")), traversala2);
    checkResults(Arrays.asList(convertToVertex(graph, "marko"), convertToVertex(graph, "vadas")), traversalb1);
    checkResults(Arrays.asList(convertToVertex(graph, "marko"), convertToVertex(graph, "vadas")), traversalb2);
    // if providers don't have their own custom GraphStep, then ignore validating compilation equality
    if ((traversala1.asAdmin().getStartStep() instanceof GraphStep) &&
            !traversala1.asAdmin().getStartStep().getClass().equals(GraphStep.class)) {
        assertEquals(traversala1, traversala2);
        assertEquals(traversalb1, traversalb2);
        assertNotEquals(traversala1, traversalb1);
        assertNotEquals(traversala1, traversalb2);
        assertNotEquals(traversala2, traversalb1);
        assertNotEquals(traversala2, traversalb2);
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:28,代码来源:HasTest.java

示例14: shouldProperlyHandleMetaProperties

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.COMPUTER) // we can't modify the graph in computer mode
public void shouldProperlyHandleMetaProperties() throws Exception {
    graph.traversal().V().has("name", "marko").properties("name").property("alias", "okram").iterate();
    final BulkLoaderVertexProgram blvp = BulkLoaderVertexProgram.build()
            .userSuppliedIds(true)
            .writeGraph(getWriteGraphConfiguration()).create(graph);
    graphProvider.getGraphComputer(graph).workers(1).program(blvp).submit().get();
    assertGraphEquality(graph, getWriteGraph());
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:12,代码来源:BulkLoaderVertexProgramTest.java

示例15: g_withPath_V_asXaX_out_out_mapXa_name_it_nameX

import org.apache.tinkerpop.gremlin.process.IgnoreEngine; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.COMPUTER)
public void g_withPath_V_asXaX_out_out_mapXa_name_it_nameX() {
    final Traversal<Vertex, String> traversal = get_g_withPath_V_asXaX_out_out_mapXa_name_it_nameX();
    int counter = 0;
    while (traversal.hasNext()) {
        counter++;
        final String doubleName = traversal.next();
        assertTrue("markoripple".equals(doubleName) || "markolop".equals(doubleName));
    }
    assertEquals(2, counter);
    assertFalse(traversal.hasNext());
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:15,代码来源:MapTest.java


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