Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass TTL in Cassandra Java Driver QueryBuilder?

I am using the QueryBuilder in the Cassandra Java driver to insert some data.

There seems to be no easy option to set the TTL on the row I am inserting. None of the examples on the DataStax site show an example with TTL.

I suspect it has something to do with using() but once again, zero examples and minimal documentation in the code...

like image 392
Jacek Furmankiewicz Avatar asked Jul 10 '14 16:07

Jacek Furmankiewicz


1 Answers

Finally figured it out, you have to pass in the static ttl() method on the QueryBuilder itself:

.using(ttl(30));
like image 78
Jacek Furmankiewicz Avatar answered Oct 12 '22 13:10

Jacek Furmankiewicz