mirror of https://github.com/apache/cassandra
cosmetic trigger corrections (examples)
This commit is contained in:
parent
76664d2c1c
commit
d7e14829fa
|
|
@ -16,6 +16,6 @@ Copy conf/* to <cassandra_home>/conf/
|
|||
Create column family configured in InvertedIndex.properties
|
||||
Example: Keyspace1.InvertedIndex as configured in InvertedIndex.properties
|
||||
Configure trigger on the table.
|
||||
Example: CREATE TRIGGER test1 ON "Keyspace1"."Standard1"
|
||||
EXECUTE ('org.apache.cassandra.triggers.InvertedIndex');
|
||||
Example: CREATE TRIGGER test1 ON "Keyspace1"."Standard1"
|
||||
USING 'org.apache.cassandra.triggers.InvertedIndex';
|
||||
Start inserting data to the column family which has the triggers.
|
||||
|
|
|
|||
|
|
@ -24,11 +24,12 @@ import java.util.Collection;
|
|||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.apache.cassandra.db.ColumnFamily;
|
||||
import org.apache.cassandra.db.RowMutation;
|
||||
import org.apache.cassandra.io.util.FileUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class InvertedIndex implements ITrigger {
|
||||
private static final Logger logger = LoggerFactory.getLogger(InvertedIndex.class);
|
||||
|
|
|
|||
|
|
@ -502,19 +502,19 @@ createIndexStatement returns [CreateIndexStatement expr]
|
|||
;
|
||||
|
||||
/**
|
||||
* CREATE TRIGGER [triggerName] ON columnFamily (columnName) EXECUTE (class, class);
|
||||
* CREATE TRIGGER triggerName ON columnFamily USING 'triggerClass';
|
||||
*/
|
||||
createTriggerStatement returns [CreateTriggerStatement expr]
|
||||
: K_CREATE K_TRIGGER (tn=IDENT) K_ON cf=columnFamilyName K_USING tc1=STRING_LITERAL
|
||||
{ $expr = new CreateTriggerStatement(cf, $tn.text, $tc1.text); }
|
||||
: K_CREATE K_TRIGGER (name=IDENT) K_ON cf=columnFamilyName K_USING cls=STRING_LITERAL
|
||||
{ $expr = new CreateTriggerStatement(cf, $name.text, $cls.text); }
|
||||
;
|
||||
|
||||
/**
|
||||
* DROP TRIGGER [triggerName] ON columnFamily (columnName);
|
||||
* DROP TRIGGER triggerName ON columnFamily;
|
||||
*/
|
||||
dropTriggerStatement returns [DropTriggerStatement expr]
|
||||
: K_DROP K_TRIGGER (tn=IDENT) K_ON cf=columnFamilyName
|
||||
{ $expr = new DropTriggerStatement(cf, $tn.text); }
|
||||
: K_DROP K_TRIGGER (name=IDENT) K_ON cf=columnFamilyName
|
||||
{ $expr = new DropTriggerStatement(cf, $name.text); }
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue