Search in sources :

Example 1 with RangeSliceCommand

use of org.apache.cassandra.db.RangeSliceCommand in project eiger by wlloyd.

the class RangeSliceVerbHandler method doVerb.

public void doVerb(Message message, String id) {
    try {
        if (StorageService.instance.isBootstrapMode()) {
            /* Don't service reads! */
            throw new RuntimeException("Cannot service reads while bootstrapping!");
        }
        RangeSliceCommand command = RangeSliceCommand.read(message);
        ColumnFamilyStore cfs = Table.open(command.keyspace).getColumnFamilyStore(command.column_family);
        RangeSliceReply reply = new RangeSliceReply(executeLocally(command));
        Message response = reply.getReply(message);
        if (logger.isDebugEnabled())
            logger.debug("Sending " + reply + " to " + id + "@" + message.getFrom());
        MessagingService.instance().sendReply(response, id, message.getFrom());
    } catch (Exception ex) {
        throw new RuntimeException(ex);
    }
}
Also used : RangeSliceReply(org.apache.cassandra.db.RangeSliceReply) Message(org.apache.cassandra.net.Message) RangeSliceCommand(org.apache.cassandra.db.RangeSliceCommand) ColumnFamilyStore(org.apache.cassandra.db.ColumnFamilyStore) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

ExecutionException (java.util.concurrent.ExecutionException)1 ColumnFamilyStore (org.apache.cassandra.db.ColumnFamilyStore)1 RangeSliceCommand (org.apache.cassandra.db.RangeSliceCommand)1 RangeSliceReply (org.apache.cassandra.db.RangeSliceReply)1 Message (org.apache.cassandra.net.Message)1