1

I am storing data in Cassandra DB based on some time intervals like 1hour, 1day, 1week, 1month and 1year, I have to set the ttl using those slots like follows

1hour, 1day and 1 week - 14days (1209600 seconds)

1month - 1month+1week ( 3297546 seconds)

1year - 1year+1week (32161752 seconds)

I found it Using using = QueryBuilder.ttl(int);

session.execute( insert.using(using) ).wasApplied();

my doubt is, will it accept those huge values?

Sat
  • 3,520
  • 9
  • 39
  • 66

1 Answers1

2

Cassandra support up to 20 years TTL. Check this SO answer. Also, the TTL is visibile in the code, here.

I think it's also worth to look on JIRA ticket 14092 regarding the max 20 years TTL and the year 2038 bug.

Horia
  • 2,942
  • 7
  • 14