Does Cassandra support TTL for the Counter column family?
Specifically we use Hector as a client to Cassandra and I didn't find any API receiving TTL as a parameter. At least HFactory.createCounterColumn
doesn't have TTL argument.
In Cassandra Both the INSERT and UPDATE commands support setting a time for data in a column to expire. It is used to set the time limit for a specific period of time. By USING TTL clause we can set the TTL value at the time of insertion. We can use TTL function to get the time remaining for a specific selected query.
Use CQL to set the TTL. To change the TTL of a specific column, you must re-insert the data with a new TTL. Cassandra upserts the column with the new TTL. To remove TTL from a column, set TTL to zero.
Cassandra also introduced counter columns as a way to support a certain kind of update atomicity in a much cheaper way than using Paxos. A counter column is a column that can contain integer values, and whose primitive operations are increment and decrement.
No. TTL expiration does not exist for counter columns. See CASSANDRA-2103 for background on why this feature doesn't make sense for Cassandra counter columns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With