添加顶点和边缘会花费更多时间使用titan + cassandra

时间:2016-10-06 08:04:23

标签: cassandra graph-databases titan tinkerpop3

添加顶点和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秒,这不是很好。

测试环境:

  1. 在Windows机器上启动cassandra
  2. 启用节俭 - &gt; nodetool.bat enablethrift
  3. 使用上述配置进行连接
  4. 任何解决方案? 批量提交是我能看到的一个选项。即使没有提交也几乎是同一时间。

0 个答案:

没有答案