Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is TTL for Cassandra counter column family supported?

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.

like image 870
VladiF Avatar asked Nov 03 '13 11:11

VladiF


People also ask

How does TTL work in Cassandra?

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.

How do I set the TTL on a Cassandra table?

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.

What is counter column in Cassandra?

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.


1 Answers

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.

like image 174
Tupshin Harper Avatar answered Oct 24 '22 02:10

Tupshin Harper