【问题标题】:Gremlin-driver cannot get repsponse from titandbGremlin-driver 无法从 titandb 获得响应
【发布时间】:2016-08-11 12:03:22
【问题描述】:

我正在尝试使用 gremlin-driver 通过 WebSockets 查询服务器 Titan 实例。 所以我有下一个依赖:

    <dependency>
        <groupId>org.apache.tinkerpop</groupId>
        <artifactId>gremlin-driver</artifactId>
        <version>3.1.1-incubating</version>
    </dependency>

尝试使用下一条命令获取值:

       List<Result> some = client.submit("g.V().has(T.label, marketplace).has('marketplace_product_id', marketplace_product_id)", params).some(1).get();

得到下一个异常:

 WARN  o.a.t.g.driver.MessageSerializer - Response [PooledUnsafeDirectByteBuf(ridx: 136, widx: 136, cap: 136)] could not be deserialized by org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0.
13:41:36.879 [gremlin-driver-loop-1] ERROR o.a.t.g.d.Handler$GremlinResponseHandler - Could not process the response
io.netty.handler.codec.DecoderException: org.apache.tinkerpop.gremlin.driver.ser.SerializationException: java.lang.IndexOutOfBoundsException: Index: 121, Size: 0

在网络上没有找到关于使用 gremlin-driver 进行 CRUD 操作的可行示例。 有谁知道如何处理?

编辑 1: 使用 titan-1.0.0-hadoop1 还尝试使用驱动程序版本 3.0.1-incubating 并得到几乎相同的 IndexOutOfBoundsException。

【问题讨论】:

  • 您使用的是什么版本的 Titan?
  • 如果你使用的是Titan 1.0版本,可能你需要使用版本为3.0.1-incubating的gremlin驱动

标签: java titan gremlin


【解决方案1】:

试试这个:可能会有帮助

List<Result> some = null; 
some = client.submit("g.V()
                 .has(T.label,marketplace)
                 .has('marketplace_product_id', marketplace_product_id)")
             .stream()**
             .map(r -> r.get(Vertex.class))**
             .collect(Collectors.toList());

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-08-25
    • 2021-07-18
    • 2018-02-20
    • 2020-12-11
    • 1970-01-01
    • 2016-10-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多