現在、私はそのようにClusterContextを開始しています:
AstyanaxContext.Builder builder = new AstyanaxContext.Builder()
.forCluster(clusterName)
.forKeyspace(keyspaceName)
.withAstyanaxConfiguration(getAstyanaxProperties(properties))
.withConnectionPoolConfiguration(getConnectionPoolProperties(properties))
.withConnectionPoolMonitor(connectionPoolMonitor);
clusterContext = builder.buildCluster(ThriftFamilyFactory.getInstance());
clusterContext.start();
cluster = clusterContext.getEntity();
単一ノードの開発環境で実行されています。キースペース、列ファミリーなども作成したいので、ClusterContext を使用しています。
さらに KeyspaceContext も起動する必要がありますか? もしそうなら、どのような目的のために、または単一の ClusterContext でキースペース/列ファミリーの管理と読み取り/書き込みのシナリオに十分ですか?
KeyspaceContext を起動すると、接続プール モニターによると、2 つのホストが追加されてアクティブになっていることがわかります。単一の Cassandra ノードをシャットダウンしても、まだ 1 つがアクティブとしてマークされているため、混乱します。
ありがとう。