我无法执行应该更新 SimpleStrategy 键空间的复制因子的 cql 语句。这很烦人,因为这适用于所有三个版本的 CQLSH。
我正在使用的键空间上下文设置为使用 cqlv3
.setCqlVersion("3.0.0")
cql:
"ALTER KEYSPACE \"" + ksContext.getKeyspaceName() + "\" WITH REPLICATION = { " +
"'class' : 'SimpleStrategy', 'replication_factor' : 3 };";
堆栈跟踪:
InvalidRequestException(why:line 1:108 no viable alternative at character '}')
at com.netflix.astyanax.thrift.ThriftConverter.ToConnectionPoolException(ThriftConverter.java:159)
at com.netflix.astyanax.thrift.AbstractOperationImpl.execute(AbstractOperationImpl.java:60)
at com.netflix.astyanax.thrift.AbstractOperationImpl.execute(AbstractOperationImpl.java:27)
at com.netflix.astyanax.thrift.ThriftSyncConnectionFactoryImpl$1.execute(ThriftSyncConnectionFactoryImpl.java:140)
at com.netflix.astyanax.connectionpool.impl.AbstractExecuteWithFailoverImpl.tryOperation(AbstractExecuteWithFailoverImpl.java:69)
at com.netflix.astyanax.connectionpool.impl.AbstractHostPartitionConnectionPool.executeWithFailover(AbstractHostPartitionConnectionPool.java:255)
at com.netflix.astyanax.thrift.ThriftColumnFamilyQueryImpl$6.execute(ThriftColumnFamilyQueryImpl.java:694)
at smail.cli.astyanax.Astyanax.execCQL(Astyanax.java:75)
at smail.cli.astyanax.Astyanax.alterReplicationFactor(Astyanax.java:307)
at smail.cli.test.SchemaTest.alterReplicationFactor(SchemaTest.java:25)
at smail.cli.test.TestSuite.runTests(TestSuite.java:39)
at smail.cli.Main.main(Main.java:22)