private static void updateExistingKeyspace(CassandraClientPool clientPool, CassandraKeyValueServiceConfig config) throws TException { clientPool.runWithRetry((FunctionCheckedException<CassandraClient, Void, TException>) client -> { KsDef originalKsDef = client.describe_keyspace(config.getKeyspaceOrThrow()); // there was an existing keyspace // check and make sure it's definition is up to date with our config KsDef modifiedKsDef = originalKsDef.deepCopy(); checkAndSetReplicationFactor( client, modifiedKsDef, config); if (!modifiedKsDef.equals(originalKsDef)) { // Can't call system_update_keyspace to update replication factor if CfDefs are set modifiedKsDef.setCf_defs(ImmutableList.of()); client.system_update_keyspace(modifiedKsDef); CassandraKeyValueServices.waitForSchemaVersions(config, client, "after updating the existing keyspace"); } return null; }); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof KsDef) return this.equals((KsDef)that); return false; }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof KsDef) return this.equals((KsDef)that); return false; }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof KsDef) return this.equals((KsDef)that); return false; }
private static void updateExistingKeyspace(CassandraClientPool clientPool, CassandraKeyValueServiceConfig config) throws TException { clientPool.runWithRetry((FunctionCheckedException<CassandraClient, Void, TException>) client -> { KsDef originalKsDef = client.describe_keyspace(config.getKeyspaceOrThrow()); // there was an existing keyspace // check and make sure it's definition is up to date with our config KsDef modifiedKsDef = originalKsDef.deepCopy(); checkAndSetReplicationFactor( client, modifiedKsDef, config); if (!modifiedKsDef.equals(originalKsDef)) { // Can't call system_update_keyspace to update replication factor if CfDefs are set modifiedKsDef.setCf_defs(ImmutableList.of()); client.system_update_keyspace(modifiedKsDef); CassandraKeyValueServices.waitForSchemaVersions(config, client, "after updating the existing keyspace"); } return null; }); }