Triggers

Triggers are identified with a name defined by:

  1. trigger_name ::= identifier

CREATE TRIGGER

CREATE TRIGGER statement:

  1. create_trigger_statement ::= CREATE TRIGGER [ IF NOT EXISTS ] trigger_name ON table_name USING string

For instance:

  1. CREATE TRIGGER myTrigger ON myTable USING 'org.apache.cassandra.triggers.InvertedIndex';

lib/triggers subdirectory of the Cassandra installation directory, it loads during cluster startup, and exists on every node that participates in a cluster. The trigger defined on a table fires before a requested DML statement occurs, which ensures the atomicity of the transaction.

DROP TRIGGER

DROP TRIGGER statement:

  1. drop_trigger_statement ::= DROP TRIGGER [ IF EXISTS ] trigger_nameON table_name

For instance:

  1. DROP TRIGGER myTrigger ON myTable;