Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Max value for TTL in cassandra

Tags:

cassandra

ttl

What is the maximum value we can assign to TTL ?

In the java driver for cassandra TTL is set as a int. Does that mean it is limited to Integer.MAX (2,147,483,647 secs) ?

like image 568
mob Avatar asked Nov 10 '14 15:11

mob


1 Answers

The maximum TTL is actually 20 years. From org.apache.cassandra.db.ExpiringCell:

public static final int MAX_TTL = 20 * 365 * 24 * 60 * 60; // 20 years in seconds

I think this is verified along both the CQL and Thrift query paths.

like image 181
Caleb Rackliffe Avatar answered Sep 27 '22 22:09

Caleb Rackliffe