简体   繁体   中英

How do I set the consistency level for a counter column family in Cassandra

I have a keyspace already defined. Can I set the consistency level for a counter column family (read and write) to ALL without affecting the rest of the keyspace? I cannot figure out how to do it from the help in the cli, but I suppose it should be possible. Something along the lines of:

update column family COUNTERS with ________

I am using the Java Hector API.

Not sure about CQL3 but you can do this while reading/writing. Example thrift client:

client.add('key1', ColumnParent(column_family='Counter1'), CounterColumn('c1', 100), ConsistencyLevel.ONE)
client.add('key1', ColumnParent(column_family='Counter1'), CounterColumn('c1', -50), ConsistencyLevel.ONE)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM