Gremlin-driver无法从titandb获得响应

时间:2016-04-19 10:50:24

标签: java titan gremlin

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

socket.setSoTimeout(30*1000);

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

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

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

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

1 个答案:

答案 0 :(得分: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());