org.apache.cassandra.service
Class StorageProxy

java.lang.Object
  extended by org.apache.cassandra.service.StorageProxy
All Implemented Interfaces:
StorageProxyMBean

public class StorageProxy
extends java.lang.Object
implements StorageProxyMBean


Method Summary
static java.util.Map<java.lang.String,Row> doReadProtocol(java.util.Map<java.lang.String,ReadCommand> readMessages)
          This is an implementation for the multiget version.
 double getRangeLatency()
           
 int getRangeOperations()
           
 double getReadLatency()
           
 int getReadOperations()
           
 double getWriteLatency()
           
 int getWriteOperations()
           
static void insert(RowMutation rm)
          Use this method to have this RowMutation applied across all replicas.
static void insertBlocking(RowMutation rm)
           
static Row readProtocol(ReadCommand command, StorageService.ConsistencyLevel consistencyLevel)
          Performs the actual reading of a row out of the StorageService, fetching a specific set of column names from a given column family.
static java.util.Map<java.lang.String,Row> readProtocol(java.lang.String[] keys, ReadCommand readCommand, StorageService.ConsistencyLevel consistencyLevel)
           
static java.util.Map<java.lang.String,Row> strongReadProtocol(java.lang.String[] keys, ReadCommand readCommand)
          This is a multiget version of the above method.
static java.util.Map<java.lang.String,Row> weakReadProtocol(java.lang.String[] keys, ReadCommand readCommand)
          This version is used when results for multiple keys needs to be retrieved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

insert

public static void insert(RowMutation rm)
Use this method to have this RowMutation applied across all replicas. This method will take care of the possibility of a replica being down and hint the data across to some other replica.

Parameters:
rm - the mutation to be applied across the replicas

insertBlocking

public static void insertBlocking(RowMutation rm)
                           throws org.apache.cassandra.service.UnavailableException
Throws:
org.apache.cassandra.service.UnavailableException

doReadProtocol

public static java.util.Map<java.lang.String,Row> doReadProtocol(java.util.Map<java.lang.String,ReadCommand> readMessages)
                                                          throws java.io.IOException,
                                                                 java.util.concurrent.TimeoutException
This is an implementation for the multiget version.

Parameters:
readMessages - map of key --> ReadMessage to be sent
Returns:
map of key --> Row
Throws:
java.io.IOException
java.util.concurrent.TimeoutException

readProtocol

public static Row readProtocol(ReadCommand command,
                               StorageService.ConsistencyLevel consistencyLevel)
                        throws java.io.IOException,
                               java.util.concurrent.TimeoutException
Performs the actual reading of a row out of the StorageService, fetching a specific set of column names from a given column family.

Throws:
java.io.IOException
java.util.concurrent.TimeoutException

readProtocol

public static java.util.Map<java.lang.String,Row> readProtocol(java.lang.String[] keys,
                                                               ReadCommand readCommand,
                                                               StorageService.ConsistencyLevel consistencyLevel)
                                                        throws java.lang.Exception
Throws:
java.lang.Exception

strongReadProtocol

public static java.util.Map<java.lang.String,Row> strongReadProtocol(java.lang.String[] keys,
                                                                     ReadCommand readCommand)
                                                              throws java.io.IOException,
                                                                     java.util.concurrent.TimeoutException
This is a multiget version of the above method.

Parameters:
tablename -
keys -
columnFamily -
start -
count -
Returns:
Throws:
java.io.IOException
java.util.concurrent.TimeoutException

weakReadProtocol

public static java.util.Map<java.lang.String,Row> weakReadProtocol(java.lang.String[] keys,
                                                                   ReadCommand readCommand)
                                                            throws java.lang.Exception
This version is used when results for multiple keys needs to be retrieved.

Parameters:
tablename - name of the table that needs to be queried
keys - keys whose values we are interested in
columnFamily - name of the "column" we are interested in
columns - the columns we are interested in
Returns:
a mapping of key --> Row
Throws:
java.lang.Exception

getReadLatency

public double getReadLatency()
Specified by:
getReadLatency in interface StorageProxyMBean

getRangeLatency

public double getRangeLatency()
Specified by:
getRangeLatency in interface StorageProxyMBean

getWriteLatency

public double getWriteLatency()
Specified by:
getWriteLatency in interface StorageProxyMBean

getReadOperations

public int getReadOperations()
Specified by:
getReadOperations in interface StorageProxyMBean

getRangeOperations

public int getRangeOperations()
Specified by:
getRangeOperations in interface StorageProxyMBean

getWriteOperations

public int getWriteOperations()
Specified by:
getWriteOperations in interface StorageProxyMBean


Copyright © 2009 The Apache Software Foundation