我是 Janusgraph 的新手,使用 Cassandra 作为后端数据库。我有一个查询,它使用查找节点的所有传入边。为此,我需要在 Janusgraph 配置中将读取一致性设置为 ONE。我尝试了以下配置,但无法获得正确的读取一致性:
public static JanusGraph create() {
JanusGraphFactory.Builder config = JanusGraphFactory.build();
config.set("storage.backend", "cassandrathrift");
config.set("storage.cassandra.keyspace", "cs_graph");
config.set("storage.cassandra.read-consistency-level","ONE");
config.set("storage.cassandra.write-consistency-level","ONE");
config.set("storage.cassandra.frame-size-mb", "128");
config.set("storage.cassandra.thrift.cpool.max-wait", 360000);
config.set("storage.hostname", "10.XXX.1.XXX");
config.set("connectionPool.keepAliveInterval","360000");
config.set("storage.cql.only-use-local-consistency-for-system-operations","true");
graph = config.open();
System.out.println("Graph = "+graph);
traversalSource = graph.traversal();
System.out.println("traversalSource = "+traversalSource);
getAllEdges();
return graph;
}
但是,客户端仍然在 QUORUM 级别的一致性中显示 CassandraTransaction。
以下是日志:
16:40:54.799 [main] 调试 ojdcassandra.CassandraTransaction - 创建 CassandraTransaction@25e2a451 [read=QUORUM,write=QUORUM] 16:40:54.800 [main] 调试 ojdcassandra.CassandraTransaction - 创建 CassandraTransaction@1698ee84[read=QUORUM,write= QUORUM] 所有边 = 100000 16:40:55.754 [main] DEBUG ojgdatabase.StandardJanusGraph - 使用关闭挂钩 Thread[Thread-5,5,main] 16:40:55.755 关闭图 standardjanusgraph[cassandrathrift:[10.70.1.167]] [main] 调试 ojdcassandra.CassandraTransaction - 创建 CassandraTransaction@3e5499cc[read=QUORUM,write=QUORUM] 16:40:55.755 [main] 调试 ojdcassandra.CassandraTransaction - 创建 CassandraTransaction@67ab1c47[read=QUORUM,write=QUORUM] 16:40 :56.113 [main] DEBUG ojdcassandra.CassandraTransaction - 创建 CassandraTransaction@6821ea29[read=QUORUM,write=QUORUM] 16:40:56.542 [main] 调试 ojdcassandra.CassandraTransaction - 创建 CassandraTransaction@338494fa[read=QUORUM,write=QUORUM] 16:40:56.909 [main] INFO ojdctCassandraThriftStoreManager - 关闭 Thrift 连接池。
关于如何将其更改为 ONE 或 LOCAL 一致性级别的任何建议?