Reference Guide
Table Of Contents
- 1 Introduction
- 2 Establishing Your Test and Development Environments
- 3 Developing Applications
- Introduction
- Authentication
- REST API
- Audit Logging
- Alert Logging
- Configuration
- High Availability
- OpenFlow
- Metrics Framework
- GUI
- SKI Framework - Overview
- SKI Framework - Navigation Tree
- SKI Framework - Hash Navigation
- SKI Framework - View Life-Cycle
- SKI Framework - Live Reference Application
- UI Extension
- Introduction
- Controller Teaming
- Distributed Coordination Service
- Persistence
- Backup and Restore
- Device Driver Framework
- 4 Application Security
- 5 Including Debian Packages with Applications
- 6 Sample Application
- Application Description
- Creating Application Development Workspace
- Application Generator (Automatic Workspace Creation)
- Creating Eclipse Projects
- Updating Project Dependencies
- Building the Application
- Installing the Application
- Application Code
- 7 Testing Applications
- 8 Built-In Applications
- Appendix A
- Appendix B
- Bibliography
case TOPIC:
StringColumn<String> topic1 =
(StringColumn) row1.getColumn(TOPIC_COL_NAME);
StringColumn<String> topic2 =
(StringColumn) row2.getColumn(TOPIC_COL_NAME);
retVal = topic1.compareTo(topic2);
break;
}
return retVal;
}
}
...
In this code, there is defined a constructor and the main column family. The Alerts in this code is
the main column family in the CassandraAlertDao and has following columns:
•
sysId
•
severity
•
timestamp
•
origin
•
topic
•
description
•
state
These columns are defined along with the data type for each column, a decoder to assist in the
read operation and a method to compare columns while sorting a read result.
In addition to this column family, free form queries are supported on a combination of values of
severity, timestamp, origin, topic, state and description.
To enable this, a secondary index for each of these columns needs to be created and maintained.
This secondary index is another column family and it is called the secondary column family. An
example is AlertsBySeverity column family as shown below.
The secondary column families use composite columns and a row in AlertsBySeverity would look
like this.
RowKey CRITICAL : 1 | CRITICAL : 2 | INFO : 3 | WARNING : 5 | ……
Here the first part of the composite column name is the value of Severity that is wanted to match
and the second part of the column name is the primary key / row key of the matching row in the
main column family. To lookup all Alerts matching Severity = CRITICAL, rows 1 and 2 will be
returned. Do an additional lookup in the main column family to retrieve the data from rows 1 and
2. Once the data is retrieved, convert the same into a storable and return the query back to the
application.
CassandraAlertDao.java AlertsBySeverity Column Family:
public static class SeverityComposite implements
Serializable, Comparable<SeverityComposite>{
@Component (ordinal = 0)
private String severity;
97