public List<LogEntry> writePending(ConsistencyLevel consistencyLevel, RowMutation rowMutation) throws Throwable {
List<String> columnNames = new ArrayList<String>();
for (ColumnFamily cf : rowMutation.getColumnFamilies()) {
for (ByteBuffer b : cf.getColumnNames()) {
columnNames.add(ByteBufferUtil.string(b));
}
}
String keyspace = rowMutation.getTable();
ByteBuffer rowKey = rowMutation.key();
List<LogEntry> entries = new ArrayList<LogEntry>();
for (Integer cfId : rowMutation.getColumnFamilyIds()) {
ColumnFamily columnFamily = rowMutation.getColumnFamily(cfId);
String path = keyspace + ":" + columnFamily.metadata().cfName;
List<Trigger> triggers = TriggerStore.getStore().getTriggers().get(path);
if (triggers != null && triggers.size() > 0) {
String hostName = LogEntryStore.getHostName();
LogEntry entry = new LogEntry(keyspace, columnFamily, rowKey, consistencyLevel, hostName,
System.currentTimeMillis(), columnNames);
entries.add(entry);
write(entry, PENDING_PRIORITY);
}
}
return entries;
}