Я использую Cassandra-2.0.10 и API Hector.
Я пытался:
public static void createCounterColumnFamily(Keyspace keyspace, String ccfName) {
Mutator<String> mutator = HFactory.createMutator(keyspace,StringSerializer.get());
mutator.addCounter("salary", ccfName, HFactory.createCounterColumn("salary", 10L));
mutator.execute();}
Но я получаю это исключение:
Exception in thread "main" me.prettyprint.hector.api.exceptions.HInvalidRequestException: InvalidRequestException(why:unconfigured columnfamily counter_column_family_1)
at me.prettyprint.cassandra.service.ExceptionsTranslatorImpl.translate(ExceptionsTranslatorImpl.java:45)
at me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:265)
at me.prettyprint.cassandra.model.ExecutingKeyspace.doExecuteOperation(ExecutingKeyspace.java:113)
at me.prettyprint.cassandra.model.MutatorImpl.execute(MutatorImpl.java:243)
at com.cassandra.practice.CounterColumnFamily.createCounterColumnFamily(CounterColumnFamily.java:18)
at com.cassandra.practice.Bootstrapper.main(Bootstrapper.java:33)
Caused by: InvalidRequestException(why:unconfigured columnfamily counter_column_family_1)
at org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:20833)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
at org.apache.cassandra.thrift.Cassandra$Client.recv_batch_mutate(Cassandra.java:964)
at org.apache.cassandra.thrift.Cassandra$Client.batch_mutate(Cassandra.java:950)
at me.prettyprint.cassandra.model.MutatorImpl$3.execute(MutatorImpl.java:246)
at me.prettyprint.cassandra.model.MutatorImpl$3.execute(MutatorImpl.java:243)
at me.prettyprint.cassandra.service.Operation.executeAndSetResult(Operation.java:104)
at me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:258)
... 4 more
Я что-то упустил?