【发布时间】:2015-10-07 09:54:02
【问题描述】:
我正在从 java 连接到 Titan(使用 titan-all-0.4.4)
TitanGraph g = TitanFactory.open("/titan-all-0.4.4/conf/titan-cassandra.properties");
titan-cassandra.properties 是 Titan 自带的默认文件。
我正在尝试在 Graph g 中插入顶点,
Vertex a = g.addVertex(null);
a.setProperty("name", "a");
Vertex b = g.addVertex(null);
b.setProperty("name", "b");
Vertex c = g.addVertex(null);
c.setProperty("name", "c");
Vertex d = g.addVertex(null);
d.setProperty("name", "d");
g.commit();`
然后我通过 Gremlin 进行查询,
g = TitanFactory.open("/titan-all-0.4.4/conf/titan-cassandra.properties");
g.V.count()
g.V.count()(或一般任何其他函数,如g.V.map())有时会返回正确的值(或数据),有时会返回不正确的值。例如。上面程序中count值是4,但有时g.V.count()返回1,有时是4。我也做了g.V.map()验证,是符合count的。 (有时并非所有数据都被检索到,有时它可以正常工作)
我应该如何确认我尝试添加到图表中的数据是否实际添加并通过 gremlin 查询来确认?
【问题讨论】:
-
听起来像是某种 cassandra 问题。
-
您是刚开始使用 Titan 吗? 9 月发布 1.0 版。 titandb.io
-
我是 Titan 的新手,我下载了 Github link 上的 Titian/All 0.4.4(向下滚动页面,有一个表格)。你认为 cassandra/Titan 有问题吗? (尽管插入顶点,有时 g.V.count() 也会显示零值)