org.apache.cassandra.service
Class CassandraServer

java.lang.Object
  extended by org.apache.cassandra.service.CassandraServer
All Implemented Interfaces:
Cassandra.Iface

public class CassandraServer
extends java.lang.Object
implements Cassandra.Iface


Field Summary
protected  StorageService storageService
           
static java.lang.String TOKEN_MAP
           
 
Constructor Summary
CassandraServer()
           
 
Method Summary
 void batch_insert(java.lang.String keyspace, java.lang.String key, java.util.Map<java.lang.String,java.util.List<ColumnOrSuperColumn>> cfmap, int consistency_level)
          Insert Columns or SuperColumns across different Column Families for the same row key.
 java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> describe_keyspace(java.lang.String table)
          describe specified keyspace
 int get_count(java.lang.String table, java.lang.String key, ColumnParent column_parent, int consistency_level)
          returns the number of columns for a particular key and ColumnFamily or SuperColumn.
 java.util.List<java.lang.String> get_key_range(java.lang.String tablename, java.lang.String columnFamily, java.lang.String startWith, java.lang.String stopAt, int maxResults, int consistency_level)
           
 java.util.List<KeySlice> get_range_slice(java.lang.String keyspace, ColumnParent column_parent, SlicePredicate predicate, java.lang.String start_key, java.lang.String end_key, int maxRows, int consistency_level)
          returns a subset of columns for a range of keys.
 java.util.List<ColumnOrSuperColumn> get_slice(java.lang.String keyspace, java.lang.String key, ColumnParent column_parent, SlicePredicate predicate, int consistency_level)
          Get the group of columns contained by column_parent (either a ColumnFamily name or a ColumnFamily/SuperColumn name pair) specified by the given SlicePredicate.
 java.util.List<java.lang.String> get_string_list_property(java.lang.String propertyName)
          get property whose value is list of strings.
 java.lang.String get_string_property(java.lang.String propertyName)
          get property whose value is of type string.
 ColumnOrSuperColumn get(java.lang.String table, java.lang.String key, ColumnPath column_path, int consistency_level)
          Get the Column or SuperColumn at the given column_path.
 void insert(java.lang.String table, java.lang.String key, ColumnPath column_path, byte[] value, long timestamp, int consistency_level)
          Insert a Column consisting of (column_path.column, value, timestamp) at the given column_path.column_family and optional column_path.super_column.
 java.util.Map<java.lang.String,java.util.List<ColumnOrSuperColumn>> multiget_slice(java.lang.String keyspace, java.util.List<java.lang.String> keys, ColumnParent column_parent, SlicePredicate predicate, int consistency_level)
          Performs a get_slice for column_parent and predicate for the given keys in parallel.
 java.util.Map<java.lang.String,ColumnOrSuperColumn> multiget(java.lang.String table, java.util.List<java.lang.String> keys, ColumnPath column_path, int consistency_level)
          always returns a ColumnOrSuperColumn for each key, even if there is no data for it
protected  java.util.Map<java.lang.String,ColumnFamily> readColumnFamily(java.util.List<ReadCommand> commands, int consistency_level)
           
 void remove(java.lang.String table, java.lang.String key, ColumnPath column_path, long timestamp, int consistency_level)
          Remove data from the row specified by key at the granularity specified by column_path, and the given timestamp.
 void start()
           
 java.util.List<ColumnOrSuperColumn> thriftifyColumns(java.util.Collection<IColumn> columns, boolean reverseOrder)
           
 java.util.List<Column> thriftifySubColumns(java.util.Collection<IColumn> columns)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOKEN_MAP

public static java.lang.String TOKEN_MAP

storageService

protected StorageService storageService
Constructor Detail

CassandraServer

public CassandraServer()
Method Detail

start

public void start()
           throws java.io.IOException
Throws:
java.io.IOException

readColumnFamily

protected java.util.Map<java.lang.String,ColumnFamily> readColumnFamily(java.util.List<ReadCommand> commands,
                                                                        int consistency_level)
                                                                 throws InvalidRequestException,
                                                                        UnavailableException,
                                                                        TimedOutException
Throws:
InvalidRequestException
UnavailableException
TimedOutException

thriftifySubColumns

public java.util.List<Column> thriftifySubColumns(java.util.Collection<IColumn> columns)

thriftifyColumns

public java.util.List<ColumnOrSuperColumn> thriftifyColumns(java.util.Collection<IColumn> columns,
                                                            boolean reverseOrder)

get_slice

public java.util.List<ColumnOrSuperColumn> get_slice(java.lang.String keyspace,
                                                     java.lang.String key,
                                                     ColumnParent column_parent,
                                                     SlicePredicate predicate,
                                                     int consistency_level)
                                              throws InvalidRequestException,
                                                     UnavailableException,
                                                     TimedOutException
Description copied from interface: Cassandra.Iface
Get the group of columns contained by column_parent (either a ColumnFamily name or a ColumnFamily/SuperColumn name pair) specified by the given SlicePredicate. If no matching values are found, an empty list is returned.

Specified by:
get_slice in interface Cassandra.Iface
Throws:
InvalidRequestException
UnavailableException
TimedOutException

multiget_slice

public java.util.Map<java.lang.String,java.util.List<ColumnOrSuperColumn>> multiget_slice(java.lang.String keyspace,
                                                                                          java.util.List<java.lang.String> keys,
                                                                                          ColumnParent column_parent,
                                                                                          SlicePredicate predicate,
                                                                                          int consistency_level)
                                                                                   throws InvalidRequestException,
                                                                                          UnavailableException,
                                                                                          TimedOutException
Description copied from interface: Cassandra.Iface
Performs a get_slice for column_parent and predicate for the given keys in parallel.

Specified by:
multiget_slice in interface Cassandra.Iface
Throws:
InvalidRequestException
UnavailableException
TimedOutException

get

public ColumnOrSuperColumn get(java.lang.String table,
                               java.lang.String key,
                               ColumnPath column_path,
                               int consistency_level)
                        throws InvalidRequestException,
                               NotFoundException,
                               UnavailableException,
                               TimedOutException
Description copied from interface: Cassandra.Iface
Get the Column or SuperColumn at the given column_path. If no value is present, NotFoundException is thrown. (This is the only method that can throw an exception under non-failure conditions.)

Specified by:
get in interface Cassandra.Iface
Throws:
InvalidRequestException
NotFoundException
UnavailableException
TimedOutException

multiget

public java.util.Map<java.lang.String,ColumnOrSuperColumn> multiget(java.lang.String table,
                                                                    java.util.List<java.lang.String> keys,
                                                                    ColumnPath column_path,
                                                                    int consistency_level)
                                                             throws InvalidRequestException,
                                                                    UnavailableException,
                                                                    TimedOutException
always returns a ColumnOrSuperColumn for each key, even if there is no data for it

Specified by:
multiget in interface Cassandra.Iface
Throws:
InvalidRequestException
UnavailableException
TimedOutException

get_count

public int get_count(java.lang.String table,
                     java.lang.String key,
                     ColumnParent column_parent,
                     int consistency_level)
              throws InvalidRequestException,
                     UnavailableException,
                     TimedOutException
Description copied from interface: Cassandra.Iface
returns the number of columns for a particular key and ColumnFamily or SuperColumn.

Specified by:
get_count in interface Cassandra.Iface
Throws:
InvalidRequestException
UnavailableException
TimedOutException

insert

public void insert(java.lang.String table,
                   java.lang.String key,
                   ColumnPath column_path,
                   byte[] value,
                   long timestamp,
                   int consistency_level)
            throws InvalidRequestException,
                   UnavailableException,
                   TimedOutException
Description copied from interface: Cassandra.Iface
Insert a Column consisting of (column_path.column, value, timestamp) at the given column_path.column_family and optional column_path.super_column. Note that column_path.column is here required, since a SuperColumn cannot directly contain binary values -- it can only contain sub-Columns.

Specified by:
insert in interface Cassandra.Iface
Throws:
InvalidRequestException
UnavailableException
TimedOutException

batch_insert

public void batch_insert(java.lang.String keyspace,
                         java.lang.String key,
                         java.util.Map<java.lang.String,java.util.List<ColumnOrSuperColumn>> cfmap,
                         int consistency_level)
                  throws InvalidRequestException,
                         UnavailableException,
                         TimedOutException
Description copied from interface: Cassandra.Iface
Insert Columns or SuperColumns across different Column Families for the same row key. batch_mutation is a map> -- a map which pairs column family names with the relevant ColumnOrSuperColumn objects to insert.

Specified by:
batch_insert in interface Cassandra.Iface
Throws:
InvalidRequestException
UnavailableException
TimedOutException

remove

public void remove(java.lang.String table,
                   java.lang.String key,
                   ColumnPath column_path,
                   long timestamp,
                   int consistency_level)
            throws InvalidRequestException,
                   UnavailableException,
                   TimedOutException
Description copied from interface: Cassandra.Iface
Remove data from the row specified by key at the granularity specified by column_path, and the given timestamp. Note that all the values in column_path besides column_path.column_family are truly optional: you can remove the entire row by just specifying the ColumnFamily, or you can remove a SuperColumn or a single Column by specifying those levels too.

Specified by:
remove in interface Cassandra.Iface
Throws:
InvalidRequestException
UnavailableException
TimedOutException

get_string_property

public java.lang.String get_string_property(java.lang.String propertyName)
Description copied from interface: Cassandra.Iface
get property whose value is of type string.

Specified by:
get_string_property in interface Cassandra.Iface

get_string_list_property

public java.util.List<java.lang.String> get_string_list_property(java.lang.String propertyName)
Description copied from interface: Cassandra.Iface
get property whose value is list of strings.

Specified by:
get_string_list_property in interface Cassandra.Iface

describe_keyspace

public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> describe_keyspace(java.lang.String table)
                                                                                                   throws NotFoundException
Description copied from interface: Cassandra.Iface
describe specified keyspace

Specified by:
describe_keyspace in interface Cassandra.Iface
Throws:
NotFoundException

get_range_slice

public java.util.List<KeySlice> get_range_slice(java.lang.String keyspace,
                                                ColumnParent column_parent,
                                                SlicePredicate predicate,
                                                java.lang.String start_key,
                                                java.lang.String end_key,
                                                int maxRows,
                                                int consistency_level)
                                         throws InvalidRequestException,
                                                UnavailableException,
                                                org.apache.thrift.TException,
                                                TimedOutException
Description copied from interface: Cassandra.Iface
returns a subset of columns for a range of keys.

Specified by:
get_range_slice in interface Cassandra.Iface
Throws:
InvalidRequestException
UnavailableException
org.apache.thrift.TException
TimedOutException

get_key_range

public java.util.List<java.lang.String> get_key_range(java.lang.String tablename,
                                                      java.lang.String columnFamily,
                                                      java.lang.String startWith,
                                                      java.lang.String stopAt,
                                                      int maxResults,
                                                      int consistency_level)
                                               throws InvalidRequestException,
                                                      org.apache.thrift.TException,
                                                      UnavailableException,
                                                      TimedOutException
Specified by:
get_key_range in interface Cassandra.Iface
Throws:
InvalidRequestException
org.apache.thrift.TException
UnavailableException
TimedOutException


Copyright © 2010 The Apache Software Foundation