public class CassandraServer extends java.lang.Object implements Cassandra.Iface
| Constructor and Description |
|---|
CassandraServer() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.nio.ByteBuffer key,
ColumnParent column_parent,
CounterColumn column,
ConsistencyLevel consistency_level)
Increment or decrement a counter.
|
void |
atomic_batch_mutate(java.util.Map<java.nio.ByteBuffer,java.util.Map<java.lang.String,java.util.List<Mutation>>> mutation_map,
ConsistencyLevel consistency_level)
Atomically mutate many columns or super columns for many row keys.
|
void |
batch_mutate(java.util.Map<java.nio.ByteBuffer,java.util.Map<java.lang.String,java.util.List<Mutation>>> mutation_map,
ConsistencyLevel consistency_level)
Mutate many columns or super columns for many row keys.
|
CASResult |
cas(java.nio.ByteBuffer key,
java.lang.String column_family,
java.util.List<Column> expected,
java.util.List<Column> updates,
ConsistencyLevel serial_consistency_level,
ConsistencyLevel commit_consistency_level)
Atomic compare and set.
|
java.lang.String |
describe_cluster_name()
get the cluster name
|
KsDef |
describe_keyspace(java.lang.String keyspaceName)
describe specified keyspace
|
java.util.List<KsDef> |
describe_keyspaces()
list the defined keyspaces in this cluster
|
java.util.List<TokenRange> |
describe_local_ring(java.lang.String keyspace)
same as describe_ring, but considers only nodes in the local DC
|
java.lang.String |
describe_partitioner()
returns the partitioner used by this cluster
|
java.util.List<TokenRange> |
describe_ring(java.lang.String keyspace)
get the token ring: a map of ranges to host addresses,
represented as a set of TokenRange instead of a map from range
to list of endpoints, because you can't use Thrift structs as
map keys:
https://issues.apache.org/jira/browse/THRIFT-162
for the same reason, we can't return a set here, even though
order is neither important nor predictable.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
describe_schema_versions()
for each schema version present in the cluster, returns a list of nodes at that version.
|
java.lang.String |
describe_snitch()
returns the snitch used by this cluster
|
java.util.List<CfSplit> |
describe_splits_ex(java.lang.String cfName,
java.lang.String start_token,
java.lang.String end_token,
int keys_per_split) |
java.util.List<java.lang.String> |
describe_splits(java.lang.String cfName,
java.lang.String start_token,
java.lang.String end_token,
int keys_per_split)
Deprecated.
|
java.util.Map<java.lang.String,java.lang.String> |
describe_token_map()
get the mapping between token->node ip
without taking replication into consideration
https://issues.apache.org/jira/browse/CASSANDRA-4092
|
java.lang.String |
describe_version()
get the thrift api version
|
CqlResult |
execute_cql_query(java.nio.ByteBuffer query,
Compression compression) |
CqlResult |
execute_cql3_query(java.nio.ByteBuffer query,
Compression compression,
ConsistencyLevel cLevel)
Executes a CQL3 (Cassandra Query Language) statement and returns a
CqlResult containing the results.
|
CqlResult |
execute_prepared_cql_query(int itemId,
java.util.List<java.nio.ByteBuffer> bindVariables) |
CqlResult |
execute_prepared_cql3_query(int itemId,
java.util.List<java.nio.ByteBuffer> bindVariables,
ConsistencyLevel cLevel)
Executes a prepared CQL3 (Cassandra Query Language) statement by passing an id token, a list of variables
to bind, and the consistency level, and returns a CqlResult containing the results.
|
int |
get_count(java.nio.ByteBuffer key,
ColumnParent column_parent,
SlicePredicate predicate,
ConsistencyLevel consistency_level)
returns the number of columns matching
predicate for a particular key,
ColumnFamily and optionally SuperColumn. |
java.util.List<KeySlice> |
get_indexed_slices(ColumnParent column_parent,
IndexClause index_clause,
SlicePredicate column_predicate,
ConsistencyLevel consistency_level)
Returns the subset of columns specified in SlicePredicate for the rows matching the IndexClause
|
java.util.List<ColumnOrSuperColumn> |
get_multi_slice(MultiSliceRequest request)
Select multiple slices of a key in a single RPC operation
|
java.util.List<KeySlice> |
get_paged_slice(java.lang.String column_family,
KeyRange range,
java.nio.ByteBuffer start_column,
ConsistencyLevel consistency_level)
returns a range of columns, wrapping to the next rows if necessary to collect max_results.
|
java.util.List<KeySlice> |
get_range_slices(ColumnParent column_parent,
SlicePredicate predicate,
KeyRange range,
ConsistencyLevel consistency_level)
returns a subset of columns for a contiguous range of keys.
|
java.util.List<ColumnOrSuperColumn> |
get_slice(java.nio.ByteBuffer key,
ColumnParent column_parent,
SlicePredicate predicate,
ConsistencyLevel 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.
|
ColumnOrSuperColumn |
get(java.nio.ByteBuffer key,
ColumnPath column_path,
ConsistencyLevel consistency_level)
Get the Column or SuperColumn at the given column_path.
|
void |
insert(java.nio.ByteBuffer key,
ColumnParent column_parent,
Column column,
ConsistencyLevel consistency_level)
Insert a Column at the given column_parent.column_family and optional column_parent.super_column.
|
void |
login(AuthenticationRequest auth_request) |
java.util.Map<java.nio.ByteBuffer,java.lang.Integer> |
multiget_count(java.util.List<java.nio.ByteBuffer> keys,
ColumnParent column_parent,
SlicePredicate predicate,
ConsistencyLevel consistency_level)
Perform a get_count in parallel on the given list
|
java.util.Map<java.nio.ByteBuffer,java.util.List<ColumnOrSuperColumn>> |
multiget_slice(java.util.List<java.nio.ByteBuffer> keys,
ColumnParent column_parent,
SlicePredicate predicate,
ConsistencyLevel consistency_level)
Performs a get_slice for column_parent and predicate for the given keys in parallel.
|
CqlPreparedResult |
prepare_cql_query(java.nio.ByteBuffer query,
Compression compression) |
CqlPreparedResult |
prepare_cql3_query(java.nio.ByteBuffer query,
Compression compression)
Prepare a CQL3 (Cassandra Query Language) statement by compiling and returning
- the type of CQL statement
- an id token of the compiled CQL stored on the server side.
|
protected PartitionIterator |
read(java.util.List<SinglePartitionReadCommand<?>> commands,
ConsistencyLevel consistency_level,
ClientState cState) |
void |
remove_counter(java.nio.ByteBuffer key,
ColumnPath path,
ConsistencyLevel consistency_level)
Remove a counter at the specified location.
|
void |
remove(java.nio.ByteBuffer key,
ColumnPath column_path,
long timestamp,
ConsistencyLevel consistency_level)
Remove data from the row specified by key at the granularity specified by column_path, and the given timestamp.
|
void |
set_cql_version(java.lang.String version) |
void |
set_keyspace(java.lang.String keyspace) |
ThriftClientState |
state() |
java.lang.String |
system_add_column_family(CfDef cf_def)
adds a column family.
|
java.lang.String |
system_add_keyspace(KsDef ks_def)
adds a keyspace and any column families that are part of it.
|
java.lang.String |
system_drop_column_family(java.lang.String column_family)
drops a column family.
|
java.lang.String |
system_drop_keyspace(java.lang.String keyspace)
drops a keyspace and any column families that are part of it.
|
java.lang.String |
system_update_column_family(CfDef cf_def)
updates properties of a column family.
|
java.lang.String |
system_update_keyspace(KsDef ks_def)
update an existing keyspace, but do not allow column family modifications.
|
java.util.List<ColumnOrSuperColumn> |
thriftifyColumns(CFMetaData metadata,
java.util.Iterator<LegacyLayout.LegacyCell> cells) |
java.nio.ByteBuffer |
trace_next_query()
Enables tracing for the next query in this connection and returns the UUID for that trace session
The next query will be traced idependently of trace probability and the returned UUID can be used to query the trace keyspace
|
void |
truncate(java.lang.String cfname)
Truncate will mark and entire column family as deleted.
|
public ThriftClientState state()
protected PartitionIterator read(java.util.List<SinglePartitionReadCommand<?>> commands, ConsistencyLevel consistency_level, ClientState cState) throws InvalidRequestException, UnavailableException, TimedOutException
public java.util.List<ColumnOrSuperColumn> thriftifyColumns(CFMetaData metadata, java.util.Iterator<LegacyLayout.LegacyCell> cells)
public java.util.List<ColumnOrSuperColumn> get_slice(java.nio.ByteBuffer key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException
Cassandra.Ifaceget_slice in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionpublic java.util.Map<java.nio.ByteBuffer,java.util.List<ColumnOrSuperColumn>> multiget_slice(java.util.List<java.nio.ByteBuffer> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException
Cassandra.Ifacemultiget_slice in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionpublic ColumnOrSuperColumn get(java.nio.ByteBuffer key, ColumnPath column_path, ConsistencyLevel consistency_level) throws InvalidRequestException, NotFoundException, UnavailableException, TimedOutException
Cassandra.Ifaceget in interface Cassandra.IfaceInvalidRequestExceptionNotFoundExceptionUnavailableExceptionTimedOutExceptionpublic int get_count(java.nio.ByteBuffer key,
ColumnParent column_parent,
SlicePredicate predicate,
ConsistencyLevel consistency_level)
throws InvalidRequestException,
UnavailableException,
TimedOutException
Cassandra.Ifacepredicate for a particular key,
ColumnFamily and optionally SuperColumn.get_count in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionpublic java.util.Map<java.nio.ByteBuffer,java.lang.Integer> multiget_count(java.util.List<java.nio.ByteBuffer> keys,
ColumnParent column_parent,
SlicePredicate predicate,
ConsistencyLevel consistency_level)
throws InvalidRequestException,
UnavailableException,
TimedOutException
Cassandra.Ifacemultiget_count in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionpublic void insert(java.nio.ByteBuffer key,
ColumnParent column_parent,
Column column,
ConsistencyLevel consistency_level)
throws InvalidRequestException,
UnavailableException,
TimedOutException
Cassandra.Ifaceinsert in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionpublic CASResult cas(java.nio.ByteBuffer key, java.lang.String column_family, java.util.List<Column> expected, java.util.List<Column> updates, ConsistencyLevel serial_consistency_level, ConsistencyLevel commit_consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException
Cassandra.Ifacecas in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionpublic void batch_mutate(java.util.Map<java.nio.ByteBuffer,java.util.Map<java.lang.String,java.util.List<Mutation>>> mutation_map, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException
Cassandra.Ifacebatch_mutate in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionpublic void atomic_batch_mutate(java.util.Map<java.nio.ByteBuffer,java.util.Map<java.lang.String,java.util.List<Mutation>>> mutation_map, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException
Cassandra.Ifaceatomic_batch_mutate in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionpublic void remove(java.nio.ByteBuffer key,
ColumnPath column_path,
long timestamp,
ConsistencyLevel consistency_level)
throws InvalidRequestException,
UnavailableException,
TimedOutException
Cassandra.Ifaceremove in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionpublic KsDef describe_keyspace(java.lang.String keyspaceName) throws NotFoundException, InvalidRequestException
Cassandra.Ifacedescribe_keyspace in interface Cassandra.IfaceNotFoundExceptionInvalidRequestExceptionpublic java.util.List<KeySlice> get_range_slices(ColumnParent column_parent, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, org.apache.thrift.TException, TimedOutException
Cassandra.Ifaceget_range_slices in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionorg.apache.thrift.TExceptionTimedOutExceptionpublic java.util.List<KeySlice> get_paged_slice(java.lang.String column_family, KeyRange range, java.nio.ByteBuffer start_column, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException
Cassandra.Ifaceget_paged_slice in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionorg.apache.thrift.TExceptionpublic java.util.List<KeySlice> get_indexed_slices(ColumnParent column_parent, IndexClause index_clause, SlicePredicate column_predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException
Cassandra.Ifaceget_indexed_slices in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionorg.apache.thrift.TExceptionpublic java.util.List<KsDef> describe_keyspaces() throws org.apache.thrift.TException, InvalidRequestException
Cassandra.Ifacedescribe_keyspaces in interface Cassandra.Ifaceorg.apache.thrift.TExceptionInvalidRequestExceptionpublic java.lang.String describe_cluster_name()
throws org.apache.thrift.TException
Cassandra.Ifacedescribe_cluster_name in interface Cassandra.Ifaceorg.apache.thrift.TExceptionpublic java.lang.String describe_version()
throws org.apache.thrift.TException
Cassandra.Ifacedescribe_version in interface Cassandra.Ifaceorg.apache.thrift.TExceptionpublic java.util.List<TokenRange> describe_ring(java.lang.String keyspace) throws InvalidRequestException
Cassandra.Ifacedescribe_ring in interface Cassandra.IfaceInvalidRequestExceptionpublic java.util.List<TokenRange> describe_local_ring(java.lang.String keyspace) throws InvalidRequestException, org.apache.thrift.TException
Cassandra.Ifacedescribe_local_ring in interface Cassandra.IfaceInvalidRequestExceptionorg.apache.thrift.TExceptionpublic java.util.Map<java.lang.String,java.lang.String> describe_token_map()
throws InvalidRequestException
Cassandra.Ifacedescribe_token_map in interface Cassandra.IfaceInvalidRequestExceptionpublic java.lang.String describe_partitioner()
throws org.apache.thrift.TException
Cassandra.Ifacedescribe_partitioner in interface Cassandra.Ifaceorg.apache.thrift.TExceptionpublic java.lang.String describe_snitch()
throws org.apache.thrift.TException
Cassandra.Ifacedescribe_snitch in interface Cassandra.Ifaceorg.apache.thrift.TException@Deprecated
public java.util.List<java.lang.String> describe_splits(java.lang.String cfName,
java.lang.String start_token,
java.lang.String end_token,
int keys_per_split)
throws org.apache.thrift.TException,
InvalidRequestException
Cassandra.Ifacedescribe_splits in interface Cassandra.Ifaceorg.apache.thrift.TExceptionInvalidRequestExceptionpublic java.util.List<CfSplit> describe_splits_ex(java.lang.String cfName, java.lang.String start_token, java.lang.String end_token, int keys_per_split) throws InvalidRequestException, org.apache.thrift.TException
describe_splits_ex in interface Cassandra.IfaceInvalidRequestExceptionorg.apache.thrift.TExceptionpublic void login(AuthenticationRequest auth_request) throws org.apache.thrift.TException
login in interface Cassandra.Ifaceorg.apache.thrift.TExceptionpublic java.lang.String system_add_column_family(CfDef cf_def) throws InvalidRequestException, SchemaDisagreementException, org.apache.thrift.TException
Cassandra.Ifacesystem_add_column_family in interface Cassandra.IfaceInvalidRequestExceptionSchemaDisagreementExceptionorg.apache.thrift.TExceptionpublic java.lang.String system_drop_column_family(java.lang.String column_family)
throws InvalidRequestException,
SchemaDisagreementException,
org.apache.thrift.TException
Cassandra.Ifacesystem_drop_column_family in interface Cassandra.IfaceInvalidRequestExceptionSchemaDisagreementExceptionorg.apache.thrift.TExceptionpublic java.lang.String system_add_keyspace(KsDef ks_def) throws InvalidRequestException, SchemaDisagreementException, org.apache.thrift.TException
Cassandra.Ifacesystem_add_keyspace in interface Cassandra.IfaceInvalidRequestExceptionSchemaDisagreementExceptionorg.apache.thrift.TExceptionpublic java.lang.String system_drop_keyspace(java.lang.String keyspace)
throws InvalidRequestException,
SchemaDisagreementException,
org.apache.thrift.TException
Cassandra.Ifacesystem_drop_keyspace in interface Cassandra.IfaceInvalidRequestExceptionSchemaDisagreementExceptionorg.apache.thrift.TExceptionpublic java.lang.String system_update_keyspace(KsDef ks_def) throws InvalidRequestException, SchemaDisagreementException, org.apache.thrift.TException
system_update_keyspace in interface Cassandra.IfaceSchemaDisagreementExceptionInvalidRequestExceptionorg.apache.thrift.TExceptionpublic java.lang.String system_update_column_family(CfDef cf_def) throws InvalidRequestException, SchemaDisagreementException, org.apache.thrift.TException
Cassandra.Ifacesystem_update_column_family in interface Cassandra.IfaceInvalidRequestExceptionSchemaDisagreementExceptionorg.apache.thrift.TExceptionpublic void truncate(java.lang.String cfname)
throws InvalidRequestException,
UnavailableException,
TimedOutException,
org.apache.thrift.TException
Cassandra.Ifacetruncate in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionorg.apache.thrift.TExceptionpublic void set_keyspace(java.lang.String keyspace)
throws InvalidRequestException,
org.apache.thrift.TException
set_keyspace in interface Cassandra.IfaceInvalidRequestExceptionorg.apache.thrift.TExceptionpublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> describe_schema_versions()
throws org.apache.thrift.TException,
InvalidRequestException
Cassandra.Ifacedescribe_schema_versions in interface Cassandra.Ifaceorg.apache.thrift.TExceptionInvalidRequestExceptionpublic void add(java.nio.ByteBuffer key,
ColumnParent column_parent,
CounterColumn column,
ConsistencyLevel consistency_level)
throws InvalidRequestException,
UnavailableException,
TimedOutException,
org.apache.thrift.TException
Cassandra.Ifaceadd in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionorg.apache.thrift.TExceptionpublic void remove_counter(java.nio.ByteBuffer key,
ColumnPath path,
ConsistencyLevel consistency_level)
throws InvalidRequestException,
UnavailableException,
TimedOutException,
org.apache.thrift.TException
Cassandra.Ifaceremove_counter in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionorg.apache.thrift.TExceptionpublic CqlResult execute_cql_query(java.nio.ByteBuffer query, Compression compression) throws org.apache.thrift.TException
execute_cql_query in interface Cassandra.Ifaceorg.apache.thrift.TExceptionpublic CqlResult execute_cql3_query(java.nio.ByteBuffer query, Compression compression, ConsistencyLevel cLevel) throws org.apache.thrift.TException
Cassandra.Ifaceexecute_cql3_query in interface Cassandra.Ifaceorg.apache.thrift.TExceptionpublic CqlPreparedResult prepare_cql_query(java.nio.ByteBuffer query, Compression compression) throws org.apache.thrift.TException
prepare_cql_query in interface Cassandra.Ifaceorg.apache.thrift.TExceptionpublic CqlPreparedResult prepare_cql3_query(java.nio.ByteBuffer query, Compression compression) throws org.apache.thrift.TException
Cassandra.Ifaceprepare_cql3_query in interface Cassandra.Ifaceorg.apache.thrift.TExceptionpublic CqlResult execute_prepared_cql_query(int itemId, java.util.List<java.nio.ByteBuffer> bindVariables) throws org.apache.thrift.TException
execute_prepared_cql_query in interface Cassandra.Ifaceorg.apache.thrift.TExceptionpublic CqlResult execute_prepared_cql3_query(int itemId, java.util.List<java.nio.ByteBuffer> bindVariables, ConsistencyLevel cLevel) throws org.apache.thrift.TException
Cassandra.Ifaceexecute_prepared_cql3_query in interface Cassandra.Ifaceorg.apache.thrift.TExceptionpublic java.util.List<ColumnOrSuperColumn> get_multi_slice(MultiSliceRequest request) throws InvalidRequestException, UnavailableException, TimedOutException
Cassandra.Ifaceget_multi_slice in interface Cassandra.IfaceInvalidRequestExceptionUnavailableExceptionTimedOutExceptionpublic void set_cql_version(java.lang.String version)
set_cql_version in interface Cassandra.Ifacepublic java.nio.ByteBuffer trace_next_query()
throws org.apache.thrift.TException
Cassandra.Ifacetrace_next_query in interface Cassandra.Ifaceorg.apache.thrift.TExceptionCopyright © 2015 The Apache Software Foundation