Graph 小灵通问题

Graph 小灵通问题,graph,gremlin,titan,Graph,Gremlin,Titan,我正在使用以下命令创建大量的Gremlin管道来查询titan graph vertex: GremlinPipeline管道=新的GremlinPipeline() 因为我找不到任何方法来释放或重置管道,所以我正在为每个需要查询的顶点创建新实例。这将创建一个内存热点。有没有办法在不创建新实例的情况下重新使用或重置管道 我尝试使用pipeline.remove()和pipeline.reset()方法,但没有成功 问候,, Karthik考虑使用childVertices启动管道。在Gremli

我正在使用以下命令创建大量的Gremlin管道来查询titan graph vertex:

GremlinPipeline管道=新的GremlinPipeline()

因为我找不到任何方法来释放或重置管道,所以我正在为每个需要查询的顶点创建新实例。这将创建一个内存热点。有没有办法在不创建新实例的情况下重新使用或重置管道

我尝试使用pipeline.remove()和pipeline.reset()方法,但没有成功

问候,,
Karthik

考虑使用
childVertices
启动管道。在Gremlin Groovy中,这将是:

childVertices._().outE().has(SCORE).or(...
或者我猜如果您直接使用GremlinPipeline,那么类似于:

new GremlinPipeline(childVertices).has(SCORE).or(....

您能否提供更多关于为什么需要创建这么多
GremlinPipeline
实例的信息?也许有更多的代码来演示您正在做什么?谢谢您的回复!在我的场景中,一个父顶点有多个子顶点。我迭代每个子顶点,以确定它是否符合某些条件。为了评估子顶点是否符合条件,我正在为每个子顶点创建管道的新实例,以确定它是否具有具有边标签“L”和边属性“P1”或“P2”或“P3”的输出边。所以我想知道我们是否可以创建管道的一个实例,并对所有子顶点重复使用相同的实例。如果您需要更多信息,请告诉我。这是示例代码
code
for(TitanVertex childVertex:childVertex){GremlinPipeline pipeline=new GremlinPipeline();//这是我创建实例的地方pipeline=pipeline.start(childVertex.outE().has(SCORE).or(someCondition);迭代器edgeIterator=pipeline.迭代器();我尝试了第二个选项“new GremlinPipeline(childVertices).has(SCORE).or(…但得到了以下异常)”,原因是:com.google.common.base.premissions.checkArgumentException位于com.thinkaurelius.titan.graphdb.query.QueryUtil.constraints2QNF(QueryUtil.java:163)其中childVertices是List类型。这会导致问题吗?您可以只做:
new GremlinPipeline(childVertices)
并让它通过,而不需要任何额外的过滤器或任何东西?这样,它应该只输出
childVertices
中的每个顶点。请查看是否可以正常工作。谢谢Stephen!我会尝试让您知道。