[英]Not loading data from titan graph with cassandra backend using gremlin.
我已經在Java中使用blueprint api在titan(cassandra后端)中添加了數據。 我在Java中使用了以下配置來插入數據。
TitanGraph getTitanGraph()
{
conf2 = new BaseConfiguration();
conf2.setProperty("storage.backend", "cassandra");
conf2.setProperty("storage.directory","/some/directory");
conf2.setProperty("storage.read-only", "false");
conf2.setProperty("attributes.allow-all", true);
return TitanFactory.open(conf2);
}
現在,我嘗試使用gremlin查詢該數據庫。 我使用以下cmd加載它
g = TitanFactory.open("bin/cassandra.local");
以下是我的cassandra.local文件
conf = new BaseConfiguration();
conf.setProperty("storage.backend","cassandra");
conf.setProperty("storage.hostname","127.0.0.1");
conf.setProperty("storage.read-only", "false");
conf.setProperty("attributes.allow-all", true)
但是當我運行“ gV”時,我得到的是空圖。 請幫忙
謝謝
確保在Java程序中進行圖形突變后,將更改提交到TitanGraph。 如果您使用的是Titan 0.5.x ,則調用為graph.commit()
。 如果您使用的是Titan 0.9.x ,則調用為graph.tx().commit()
。
請注意, storage.directory
對Cassandra后端無效,但是storage.hostname
的默認值為127.0.0.1,因此Java程序和cassandra.local之間的值應該相同。 使用屬性文件存儲連接屬性可能會更容易。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.