I was going through the triggers implementation in cassandra. I wanted to implement triggers so as to update a table with old values of the tables that has been modified. suppose i have a table say test_table in keyspace keyspace1. i also have a table say table_track in the same keyspace with columns columnname and columnvalue. now when a row is updated in test_table, i would like to populate the track_table with row data(in test_table before update query was executed) in to the columns columnname and columnvalue respectively.
i couldn't find any proper documentation regarding cassandra triggers anywhere. i managed to somehow implement InvertedIndex and some minor examples
public Collection<Mutation> augment(ByteBuffer key, ColumnFamily update)
{
List<Mutation> mutations = new ArrayList<Mutation>(update.getColumnCount());
for (Cell cell : update)
{
// Skip the row marker and other empty values, since they lead to an empty key.
if (cell.value().remaining() > 0)
{
Mutation mutation = new Mutation(properties.getProperty("keyspace"), cell.value());
mutation.add(properties.getProperty("columnfamily"), cell.name(), key, System.currentTimeMillis());
mutations.add(mutation);
}
}
return mutations;
}
how can i modify the augment method to implement the functionality. Tnx