Reference Guide

Table Of Contents
context.getTransactionContext()
.prepareTransaction(AlertsByOrigin.COL_FAMILY.getName(),
AlertsByOrigin.ROW_KEY);
CassandraStorable<String, Origin> rows = context
.getTransactionContext().
executeCriticalSection(procedure);
Collection<String> id = new ArrayList<String>();
for (Column<Origin, ?> orig : rows.getColumns()) {
id.add(orig.getName().getValue().getId());
}
// Add row Id's to the final Id set
rowsSet.retainAll(id);
}
// Severity Condition. Only IN is supported for now.
if (filter.getSeverityCondition() != null) {
switch(filter.getSeverityCondition().getMode()) {
case IN:
for (Severity sev : filter.getSeverityCondition().
getValues()) {
final ByteBufferRange range = AlertsBySeverity.serializer
.buildRange().withPrefix(sev.name()).
greaterThan(" ").lessThanEquals("~");
Procedure<CassandraStorable<String, SeverityComposite>>
procedure = new Procedure<CassandraStorable<String,
SeverityComposite>>() {
@Override
public CassandraStorable<String,
SeverityComposite> execute()
throws Exception {
return context.getContext()
.get(AlertsBySeverity.COL_FAMILY,
AlertsBySeverity.ROW_KEY, range,
AlertsBySeverity.SEVERITY_DECODER);
}
};
context.getTransactionContext()
.prepareTransaction(
AlertsBySeverity.COL_FAMILY.getName(),
AlertsBySeverity.ROW_KEY);
CassandraStorable<String, SeverityComposite> rows =
context.getTransactionContext().
106