GremlinServer-gremlin语句提交时的异常

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/menggudaoke/article/details/80199066

1.  JanusGraph的client提交gremlin语句到tinkerpop server,如果数据量过大,会提示超过maxContentLength的异常

    异常信息:io.netty.handler.codec.CorruptedFrameException: Max frame length of 6553 has been exceeded.

    1.1) 注意:查询结果也受此配置大小的限制,如果配置的过小,查询数据也会报该异常

2.  如果是参数化gremlin语句,参数过多,会提示超过maxParameters:的异常(参数默认为16个)

    异常信息:ResponseException : The [eval] message contains 41 bindings which is more than is allowed by the server 16 configuration

3. 把maxContentLength 和 maxParameters设置的很大,再次提交gremlin,会提示gremlin script class文件过大异常,原因是gremlin脚本会被编译成.class文件,而.class文件有大小限制

    3.1)注意:属性长度大小会影响maxContentLength,但不会影响gremlin script class文件大小,因为参数化gremlin以后,属性会以变量形式传入而不是直接把值传入class文件

     3.2)但是:属性的多少会影响gremlin script class的大小,所以,需要控制属性的多少

4. gremlin的语句再缩小(通过减少属性的数量来控制),会报java.util.concurrent.ExecutionException: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: The Gremlin statement that was submitted exceed the maximum compilation size allowed by the JVM, please split it into multiple smaller statements 异常,原因是参数化gremlin语句在编译时有长度限制(但这个长度具体是多少,还没有用测试出来),再次缩小gremlin,就会提交成功了

总结:提交gremlin参数化语句时,参数map.size()有大小限制;提交的语句的大小有限制;gremlin编译为.class有限制

猜你喜欢

转载自blog.csdn.net/menggudaoke/article/details/80199066