本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.Traversal.iterate方法的典型用法代码示例。如果您正苦于以下问题:Java Traversal.iterate方法的具体用法?Java Traversal.iterate怎么用?Java Traversal.iterate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.process.traversal.Traversal
的用法示例。
在下文中一共展示了Traversal.iterate方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: g_withSideEffectXsgX_V_hasXname_danielXout_capXsgX
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的package包/类
@Test
@LoadGraphWith(CREW)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = FEATURE_ADD_EDGES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
public void g_withSideEffectXsgX_V_hasXname_danielXout_capXsgX() throws Exception {
final Configuration config = graphProvider.newGraphConfiguration("subgraph", this.getClass(), name.getMethodName(), CREW);
graphProvider.clear(config);
final Graph subgraph = graphProvider.openTestGraph(config);
/////
final Traversal<Vertex, Vertex> traversal = get_g_withSideEffectXsgX_V_hasXname_danielX_outE_subgraphXsgX_inV(subgraph);
printTraversalForm(traversal);
traversal.iterate();
assertVertexEdgeCounts(subgraph, 3, 2);
final List<String> locations = subgraph.traversal().V().has("name", "daniel").<String>values("location").toList();
assertThat(locations, contains("spremberg", "kaiserslautern", "aachen"));
graphProvider.clear(subgraph, config);
}
示例2: compareQueryTraversalSegment
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的package包/类
private static void compareQueryTraversalSegment(Traversal<?, ?> gremlinTraversal, Traversal<?, ?> mongoTraversal) {
gremlinTraversal.iterate();
mongoTraversal.iterate();
for (int i = 0; i < mongoTraversal.asAdmin().getSteps().size() - 1; i++) {
assertEquals(mongoTraversal.asAdmin().getSteps().get(i), gremlinTraversal.asAdmin().getSteps().get(i));
}
}
示例3: g_V_matchXa_knows_b__c_knows_bX
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的package包/类
@LoadGraphWith(MODERN)
public void g_V_matchXa_knows_b__c_knows_bX() {
final Traversal<Vertex, Map<String, Vertex>> traversal = get_g_V_matchXa_knows_b__c_knows_bX();
try {
printTraversalForm(traversal);
traversal.iterate();
fail("Should have tossed an exception because match pattern is not solvable");
} catch (Exception ex) {
final Throwable root = ExceptionUtils.getRootCause(ex);
assertThat(root.getMessage(), startsWith("The provided match pattern is unsolvable:"));
}
}
示例4: g_V_matchXa_created_b__c_created_bX_selectXa_b_cX_byXnameX
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的package包/类
@LoadGraphWith(MODERN)
public void g_V_matchXa_created_b__c_created_bX_selectXa_b_cX_byXnameX() throws Exception {
final Traversal<Vertex, Map<String, String>> traversal = get_g_V_matchXa_created_b__c_created_bX_selectXa_b_cX_byXnameX();
try {
printTraversalForm(traversal);
traversal.iterate();
fail("Should have tossed an exception because match pattern is not solvable");
} catch (Exception ex) {
final Throwable root = ExceptionUtils.getRootCause(ex);
assertThat(root.getMessage(), startsWith("The provided match pattern is unsolvable:"));
}
}
示例5: g_V_out_asXcX_matchXb_knows_a__c_created_eX_selectXcX
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的package包/类
@LoadGraphWith(MODERN)
public void g_V_out_asXcX_matchXb_knows_a__c_created_eX_selectXcX() throws Exception {
final Traversal<Vertex, String> traversal = get_g_V_out_asXcX_matchXb_knows_a__c_created_eX_selectXcX();
try {
printTraversalForm(traversal);
traversal.iterate();
fail("Should have tossed an exception because match pattern is not solvable");
} catch (Exception ex) {
final Throwable root = ExceptionUtils.getRootCause(ex);
assertThat(root.getMessage(), startsWith("The provided match pattern is unsolvable:"));
}
}
示例6: modern_V_out_out_profileXmetricsX
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的package包/类
@Test
@LoadGraphWith(MODERN)
public void modern_V_out_out_profileXmetricsX() {
final Traversal<Vertex, Vertex> traversal = get_g_V_out_out_profileXmetricsX();
printTraversalForm(traversal);
traversal.iterate();
validate_g_V_out_out_profile_modern(traversal, traversal.asAdmin().getSideEffects().<TraversalMetrics>get(METRICS_KEY));
}
示例7: grateful_V_out_out_profileXmetricsX
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的package包/类
@Test
@LoadGraphWith(GRATEFUL)
public void grateful_V_out_out_profileXmetricsX() {
final Traversal<Vertex, Vertex> traversal = get_g_V_out_out_profileXmetricsX();
printTraversalForm(traversal);
traversal.iterate();
final TraversalMetrics traversalMetrics = traversal.asAdmin().getSideEffects().<TraversalMetrics>get(METRICS_KEY);
validate_g_V_out_out_profile_grateful(traversalMetrics);
}
示例8: g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profileXmetricsX
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的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);
}
示例9: g_V_repeat_both_profileXmetricsX
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的package包/类
@Test
@LoadGraphWith(MODERN)
public void g_V_repeat_both_profileXmetricsX() {
final Traversal<Vertex, Vertex> traversal = get_g_V_repeatXbothX_timesX3X_profileXmetricsX();
printTraversalForm(traversal);
traversal.iterate();
final TraversalMetrics traversalMetrics = traversal.asAdmin().getSideEffects().<TraversalMetrics>get(METRICS_KEY);
validate_g_V_repeat_both_modern_profile(traversalMetrics,
traversal.asAdmin().getStrategies().toList().contains(RepeatUnrollStrategy.instance()) &&
!traversal.asAdmin().getStrategies().toList().contains(ComputerVerificationStrategy.instance()));
}
示例10: g_V_whereXinXcreatedX_count_isX1XX_name_profileXmetricsX
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的package包/类
@Test
@LoadGraphWith(MODERN)
public void g_V_whereXinXcreatedX_count_isX1XX_name_profileXmetricsX() {
final Traversal<Vertex, String> traversal = get_g_V_whereXinXcreatedX_count_isX1XX_name_profileXmetricsX();
printTraversalForm(traversal);
traversal.iterate();
final TraversalMetrics traversalMetrics = traversal.asAdmin().getSideEffects().<TraversalMetrics>get(METRICS_KEY);
validate_g_V_whereXinXcreatedX_count_isX1XX_name_profile(traversal, traversalMetrics);
}
示例11: testProfileStrategyCallbackSideEffect
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的package包/类
@Test
@LoadGraphWith(MODERN)
public void testProfileStrategyCallbackSideEffect() {
final Traversal<Vertex, Vertex> t = get_g_V_out_out_profileXmetricsX();
MockStep mockStep = new MockStep(t.asAdmin());
t.asAdmin().addStep(3, mockStep);
t.iterate();
assertTrue(mockStep.callbackCalled);
if (!onGraphComputer(t.asAdmin())) {
final TraversalMetrics traversalMetrics = t.asAdmin().getSideEffects().<TraversalMetrics>get(METRICS_KEY);
assertEquals(100, traversalMetrics.getMetrics(3).getCount("bogusCount").longValue());
}
}
示例12: g_V_matchXa_created_b__b_in_count_isXeqX1XXX_selectXa_bX_profile
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的package包/类
@Test
@LoadGraphWith(MODERN)
public void g_V_matchXa_created_b__b_in_count_isXeqX1XXX_selectXa_bX_profile() {
final Traversal<Vertex, TraversalMetrics> traversal = get_g_V_matchXa_created_b__b_in_count_isXeqX1XXX_selectXa_bX_profile();
printTraversalForm(traversal);
traversal.iterate();
}
示例13: g_V_matchXa_created_b__b_in_count_isXeqX1XXX_selectXa_bX_profileXmetricsX
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的package包/类
@Test
@LoadGraphWith(MODERN)
public void g_V_matchXa_created_b__b_in_count_isXeqX1XXX_selectXa_bX_profileXmetricsX() {
final Traversal<Vertex, Map<String, String>> traversal = get_g_V_matchXa_created_b__b_in_count_isXeqX1XXX_selectXa_bX_profileXmetricsX();
printTraversalForm(traversal);
traversal.iterate();
}
示例14: g_V_hasLabelXpersonX_pageRank_byXrankX_byXbothEX_rank_profile
import org.apache.tinkerpop.gremlin.process.traversal.Traversal; //导入方法依赖的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);
}
}