简体   繁体   English

格雷姆林遍历膨胀(OLTP)

[英]Gremlin Traversal Bulking (OLTP)

While i understand the principle of Bulking, i am curious to know how does the machine make that happen from a programatic point of you. 虽然我了解Bulking的原理,但我很想知道机器是如何从您的编程角度实现这一目标的。 How to detect that multiple Traverser are on the same node, to decide to merge and bulk them. 如何检测多个Traverser在同一节点上,以决定合并和批量处理它们。 Is there any description somewhere of the algorithm used for detecting that a specific situation requires a Bulk. 是否有描述用于检测特定情况需要批量处理的算法。

Also, what are the explicits Step that would trigger a bulk. 此外,触发批量的显式步骤是什么。 Is there any instructions that can be added to the traversal that will make the bulk happen explicitly ? 是否可以在遍历中添加任何指令,以使大量操作显式发生?

Bulking typically occurs in relation to a barrier() step and is discussed a bit in TinkerPop's reference documentation here . 填充剂通常发生在相对于barrier()步骤和讨论TinkerPop有关的参考文档中一个位在这里 Most folks don't use barrier() directly in their Gremlin writing (though you can) as various Traversal Strategies built into TinkerPop (like LazyBarrierStrategy as an example) try to automatically inject them into the traversal in places where they might do some good. 大多数人并不会在Gremlin写作中直接使用barrier() (尽管可以),因为TinkerPop中内置了各种遍历策略(例如LazyBarrierStrategy )试图将它们自动注入遍历中可能LazyBarrierStrategy地方。

You can see where/when barrier() steps are being injected by doing an explain() on your traversal: 您可以通过在遍历上执行explain()来查看在何处/何时barrier()步骤:

gremlin> g.V().out().both().explain()
==>Traversal Explanation
=======================================================================================================================================
Original Traversal                 [GraphStep(vertex,[]), VertexStep(OUT,vertex), VertexStep(BOTH,vertex)]

ConnectiveStrategy           [D]   [GraphStep(vertex,[]), VertexStep(OUT,vertex), VertexStep(BOTH,vertex)]
IncidentToAdjacentStrategy   [O]   [GraphStep(vertex,[]), VertexStep(OUT,vertex), VertexStep(BOTH,vertex)]
MatchPredicateStrategy       [O]   [GraphStep(vertex,[]), VertexStep(OUT,vertex), VertexStep(BOTH,vertex)]
RepeatUnrollStrategy         [O]   [GraphStep(vertex,[]), VertexStep(OUT,vertex), VertexStep(BOTH,vertex)]
PathRetractionStrategy       [O]   [GraphStep(vertex,[]), VertexStep(OUT,vertex), VertexStep(BOTH,vertex)]
FilterRankingStrategy        [O]   [GraphStep(vertex,[]), VertexStep(OUT,vertex), VertexStep(BOTH,vertex)]
InlineFilterStrategy         [O]   [GraphStep(vertex,[]), VertexStep(OUT,vertex), VertexStep(BOTH,vertex)]
AdjacentToIncidentStrategy   [O]   [GraphStep(vertex,[]), VertexStep(OUT,vertex), VertexStep(BOTH,vertex)]
CountStrategy                [O]   [GraphStep(vertex,[]), VertexStep(OUT,vertex), VertexStep(BOTH,vertex)]
LazyBarrierStrategy          [O]   [GraphStep(vertex,[]), VertexStep(OUT,vertex), NoOpBarrierStep(2500), VertexStep(BOTH,vertex)]
TinkerGraphCountStrategy     [P]   [GraphStep(vertex,[]), VertexStep(OUT,vertex), NoOpBarrierStep(2500), VertexStep(BOTH,vertex)]
TinkerGraphStepStrategy      [P]   [TinkerGraphStep(vertex,[]), VertexStep(OUT,vertex), NoOpBarrierStep(2500), VertexStep(BOTH,vertex)]
ProfileStrategy              [F]   [TinkerGraphStep(vertex,[]), VertexStep(OUT,vertex), NoOpBarrierStep(2500), VertexStep(BOTH,vertex)]
StandardVerificationStrategy [V]   [TinkerGraphStep(vertex,[]), VertexStep(OUT,vertex), NoOpBarrierStep(2500), VertexStep(BOTH,vertex)]

Final Traversal                    [TinkerGraphStep(vertex,[]), VertexStep(OUT,vertex), NoOpBarrierStep(2500), VertexStep(BOTH,vertex)]

在这里,在上面的@stephen评论之后,我只想分享一个博客的链接,其中一个博客深入解释了著名的LazyBarrierStrategy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM