我正在使用 datastax-5.0.5 版本以及具有依赖项的客户端 jar:dse-driver (version-1.1.1-beta1)
和 gremlin-driver(版本- 3.2.0-incubating)
以下查询在尝试使用图表上的大约 4000 个节点时给出了很好的结果。:查询:
g.V().hasLabel('Person').has('name','Person1').outE('BELONGS').inV().inE('HAS').outV().as('x').inE('HAS').outV().as('y').inE('HAS').outV().has('name','App1').select('x').inE('HAS').outV().hasLabel('Org').as('p').repeat(outE('HAS').dedup().otherV()).until(outE().hasLabel('IS')).has('Asset','name','Asset100').select('y').inE('HAS').outV().hasLabel('Class').repeat(inE('IS').dedup().otherV()).until(inE().hasLabel('HAS')).has('Asset','name','Asset100')
但是在尝试使用大约 1100 万个节点时,同样会花费很长时间并给出无效查询异常。注意:通过在 datastax-studio gremlin-console 上运行相同的查询,它可以快速返回良好的结果。
请说明相同的原因可能是什么?
以下是相同的错误日志:
Exception in thread "main" com.datastax.driver.core.exceptions.InvalidQueryException:
at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
at com.datastax.driver.dse.DriverThrowables.propagateCause(DriverThrowables.java:29)
at com.datastax.driver.dse.DefaultDseSession.executeGraph(DefaultDseSession.java:78)
at com.datastax.driver.dse.DefaultDseSession.executeGraph(DefaultDseSession.java:65)
at myGraph.Load.authorizeNodeORFindNode(Load.java:207)
at myGraph.Load.main(Load.java:314)
Caused by: com.datastax.driver.core.exceptions.InvalidQueryException:
at com.datastax.driver.core.Responses$Error.asException(Responses.java:136)
at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:177)
at com.datastax.driver.core.RequestHandler.access$2500(RequestHandler.java:46)
at com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java:797)
at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:631)
at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1070)
at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:993)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1280)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:890)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:564)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:505)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:419)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:391)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:145)
at java.lang.Thread.run(Thread.java:745)
谢谢
瓦伦塔欣