Configuration

andrewswan edited this page Jul 9, 2012 · 4 revisions

The triggers functionality uses a keyspace called "triggers", which has two column families for configuration (Configuration and Triggers) and a pair of column families for each host (CommitLog_* and ErrorLog_*). The purpose and schema for each of those tables is described below.

The keyspace and column families are created for you at runtime.

CF: Configuration

This column family has the high-level run-time configuration. Presently there is only one option, which allows the user to enable or disable the commit log. They do that by modifying the "enabled" column in the "CommitLog" row. Unless the row exists and the value is set to "true", the commit log is disabled.

CF: Triggers

This column family is a list of triggers mapped to keyspace/column families. There should be a row for each keyspace/column family for which you want triggers to fire. The row key is the keyspace and column family name separated by a colon. A column is then inserted for each trigger. The column name is the name of the trigger's Java class. The column value should be "enabled" to enable the trigger, else the trigger will not fire.

CF: CommitLog_*

One column family is used per Cassandra host as an event log. The name of the column family is CommitLog_{hostName}, where "{hostName}" is a sanitized version of the IP host name. For each RowMutation against a column family, a row is inserted into this column family with the metadata for that mutation. The row key is a rotating integer. Each row has the following columns: ks, cf, row, and status, which represent the mutation's keyspace, column family, row key and status respectively. Additionally, each mutated column name is written to the row. The value stored in each of those columns is either: "UPDATE" or "DELETE", depending on the operation performed on that column.

CF: ErrorLog_*

One column family is used per Cassandra host as an error log. The name of the column family is ErrorLog_{hostName}, where "{hostName}" is a sanitized version of the IP host name. If the trigger execution fails, an error is logged in this column family.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.