Stanislav Trifan
Stanislav Trifan

Reputation: 154

Gremlin-driver cannot get repsponse from titandb

I'm trying to query a server titan instance via WebSockets using gremlin-driver. so I have next dependency:

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

Trying to get a value using next command:

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

And getting next exception:

 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

Didn't found a workable example over the web about CRUD actions using gremlin-driver. Does anyone know how to deal with that?

Edit 1: Using titan-1.0.0-hadoop1 Tried also with driver version 3.0.1-incubating and got almost the same IndexOutOfBoundsException.

Upvotes: 2

Views: 485

Answers (1)

nemo
nemo

Reputation: 31

try this: May be it will help

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());

Upvotes: 1

Related Questions