SDN Controller Programming Guide
100
@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().
executeCriticalSection(procedure);
Collection<String> id = new ArrayList<String>();
for (Column<SeverityComposite, ?> sevRow :
rows.getColumns()) {
id.add(sevRow.getName().getValue().getId());
}
if (rowsSet.isEmpty()) {
rowsSet.addAll(id);
} else {
rowsSet.retainAll(id);
}
}
}
}
//Topic filter
if (filter.getTopicCondition() != null) {
final ByteBufferRange range;
switch (filter.getTopicCondition().getMode()) {
case EQUAL:
range = AlertsByOrigin.serializer.buildRange()
.withPrefix(filter.getTopicCondition()
.getValue());
break;
case STARTS_WITH:
range = AlertsByOrigin.serializer.buildRange()
.greaterThanEquals(filter