Trigger for TTL

228 views
Skip to first unread message

ghazi.nace...@gmail.com

unread,
Jun 11, 2018, 12:50:42 PM6/11/18
to DataStax Java Driver for Apache Cassandra User Mailing List

Hello,

I am asking if there is a trigger that detects the TTL mechanism ?

I appreciate your help.

Andrew Tolbert

unread,
Jun 11, 2018, 10:55:27 PM6/11/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Hello,

Unfortunately I don't think I completely understand your question.  Are you referring to the Triggers feature in Cassandra, or like some kind of event listener that detects when someone configures a Statement with a TTL in the driver?

Thanks!
Andy

Ghazi Naceur

unread,
Jun 12, 2018, 1:11:20 AM6/12/18
to java-dri...@lists.datastax.com
Hello,

I am referring to the Cassandra Trigger. In fact, I integrated a trigger that detects the CRUD operations and synchronizes the data in Elasticsearch.
I noticed that the TTL mechanism is not considered as a delete operation, because when data is deleted from Cassandra (after the TTL expiration), nothing happened in Elasticsearch and data remains. So I am asking is there a trigger that can detects the TTL mechanism ?
The same matter is noticed as well with the TRUNCATE operation.

Thank you for your reply.

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Jacques-Henri Berthemet

unread,
Jun 12, 2018, 3:59:32 AM6/12/18
to java-dri...@lists.datastax.com

Hi,

 

Youd have to develop your own custom secondary index as a plugin for Cassandra, note that DSE has slightly different interfaces so if you target DSE make sure you build using their jars. Also make sure Datastax will support such plugin.

 

Once you implement https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/index/Index.java youll have to implement Indexer inner class that has removeRow() and partitionDelete() methods, they are called when a row is TTLed. Be careful because there are cases where those methods are called while its not a TTL.

 

Cassandra has a Trigger interface but as far as I know its not called when TTL is triggered.

 

Regards,

--

Jacques-Henri Berthemet

--

Ghazi Naceur

unread,
Jun 12, 2018, 4:13:26 AM6/12/18
to java-dri...@lists.datastax.com
Hello,

Thank you so much ! I appreciate your help !

Best Regards !

To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.

Message has been deleted

senthil cr

unread,
Aug 8, 2018, 3:07:42 AM8/8/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi There,

can you let know whether you were able to implement triggers on ttl.

Regards,
Senthil

Ghazi Naceur

unread,
Aug 8, 2018, 4:03:52 PM8/8/18
to java-dri...@lists.datastax.com
Hi everyone,

No, I didn't implement it.

Best regards.

--
Reply all
Reply to author
Forward
0 new messages