添加顶点和egdes需要更多时间。我正在创建4个顶点和3个边缘。
我的代码如下所示
val conf = new BaseConfiguration()
conf.setProperty("storage.backend", "cassandra")
conf.setProperty("storage.hostname","127.0.0.1")
conf.setProperty("storage.cassandra.keyspace","test")
conf.setProperty("storage.batch-loading","true")
val graph: TitanGraph = TitanFactory.open (conf)
val start_time = System.currentTimeMillis()
val v0 = graph + "A"
for (nr <- List(B,C,D) {
val v1 = graph + nr
v0 --- ("interference", 10) --> v1
}
val end_time = System.currentTimeMillis()
graph.tx.commit()
println("Time taken to commit"+(end_time - start_time))
}
这会添加4个顶点和3个边缘。
提交时间2785 时间约为2秒,这不是很好。
测试环境:
任何解决方案? 批量提交是我能看到的一个选项。即使没有提交也几乎是同一时间。