You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by Apache Wiki <wi...@apache.org> on 2010/06/11 23:15:40 UTC

[Cassandra Wiki] Update of "API" by ErikLogtenberg

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for change notification.

The "API" page has been changed by ErikLogtenberg.
The comment on this change is: specified argument types for all methods.
http://wiki.apache.org/cassandra/API?action=diff&rev1=59&rev2=60

--------------------------------------------------

  === login ===
  ''Requires Cassandra 0.6''
  
-  . `void login(keyspace, auth_request)`
+  . `void login(string keyspace, AuthenticationRequest auth_request)`
  
  Authenticates with the cluster for operations on the specified keyspace using the specified `AuthenticationRequest` credentials. Throws `AuthenticationException` if the credentials are invalid or `AuthorizationException` if the credentials are valid, but not for the specified keyspace.
  
  === get ===
-  . `ColumnOrSuperColumn get(keyspace, key, column_path, consistency_level)`
+  . `ColumnOrSuperColumn get(string keyspace, string key, ColumnPath column_path, ConsistencyLevel consistency_level)`
  
  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.)
  
  === get_slice ===
-  . `list<ColumnOrSuperColumn> get_slice(keyspace, key, column_parent, predicate, consistency_level)`
+  . `list<ColumnOrSuperColumn> get_slice(string keyspace, string 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` struct.
  
  === multiget ===
  ''Deprecated in 0.6 - use `multiget_slice` instead''
  
-  . `map<string,ColumnOrSuperColumn> multiget(keyspace, keys, column_path, consistency_level)`
+  . `map<string,ColumnOrSuperColumn> multiget(string keyspace, list<string> keys, ColumnPath column_path, ConsistencyLevel consistency_level)`
  
  Perform a `get` for `column_path` in parallel on the given `list<string> keys`.  The return value maps keys to the `ColumnOrSuperColumn` found.  If no value corresponding to a key is present, the key will still be in the map, but both the `column` and `super_column` references of the `ColumnOrSuperColumn` object it maps to will be null.
  
  === multiget_slice ===
-  . `map<string,list<ColumnOrSuperColumn>> multiget_slice(keyspace, keys, column_parent, predicate, consistency_level)`
+  . `map<string,list<ColumnOrSuperColumn>> multiget_slice(string keyspace, list<string> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level)`
  
  Retrieves slices for `column_parent` and `predicate` on each of the given keys in parallel. Keys are a `list<string> of the keys to get slices for.
  
  This is similar to `get_range_slices` (Cassandra 0.6) or `get_range_slice` (Cassandra 0.5) except operating on a set of non-contiguous keys instead of a range of keys.
  
  === get_count ===
-  . `i32 get_count(keyspace, key, column_parent, consistency_level)`
+  . `i32 get_count(string keyspace, string key, ColumnParent column_parent, ConsistencyLevel consistency_level)`
  
  Counts the columns present in `column_parent`.
  
@@ -264, +264 @@

  === get_range_slice ===
  ''Deprecated in 0.6 - use `get_range_slices` instead''
  
-  . `list<KeySlice> get_range_slice(keyspace, column_parent, predicate, start_key, finish_key, row_count=100, consistency_level)`
+  . `list<KeySlice> get_range_slice(string keyspace, ColumnParent column_parent, SlicePredicate predicate, string start_key, string finish_key, i32 row_count=100, ConsistencyLevel consistency_level)`
  
  Replaces `get_key_range`. Returns a list of slices, sorted by row key, starting with start, ending with finish (both inclusive) and at most count long. The empty string ("") can be used as a sentinel value to get the first/last existing key (or first/last column in the column predicate parameter). Unlike get_key_range, this applies the given predicate to all keys in the range, not just those with undeleted matching data.  This method is only allowed when using an order-preserving partitioner in 0.5.
  
  === get_range_slices ===
  ''Requires Cassandra 0.6''
  
-  . `list<KeySlice> get_range_slices(keyspace, column_parent, predicate, range, consistency_level)`
+  . `list<KeySlice> get_range_slices(string keyspace, ColumnParent column_parent, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level)`
  
  Replaces `get_range_slice`. Returns a list of slices for the keys within the specified `KeyRange`. Unlike get_key_range, this applies the given predicate to all keys in the range, not just those with undeleted matching data.
  
@@ -280, +280 @@

  
  ''Removed in 0.6 - use `get_range_slices` instead''
  
-  . `list<string> get_key_range(keyspace, column_family, start, finish, count=100, consistency_level)`
+  . `list<string> get_key_range(string keyspace, ColumnFamily column_family, string start, string finish, i32 count=100, ConsistencyLevel consistency_level)`
  
  Returns a list of keys starting with `start`, ending with `finish` (both inclusive), and at most `count` long.  The empty string ("") can be used as a sentinel value to get the first/last existing key.  (The semantics are similar to the corresponding components of `SliceRange`.)
  
  === insert ===
-  . `insert(keyspace, key, column_path, value, timestamp, consistency_level)`
+  . `void insert(string keyspace, string key, ColumnPath column_path, binary value, i64 timestamp, ConsistencyLevel 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`.  Note that `column_path.column` is here required, since a !SuperColumn cannot directly contain binary values -- it can only contain sub-Columns.
  
  === batch_insert ===
  ''Deprecated in 0.6 - use `batch_mutate` instead''
  
-  . `batch_insert(keyspace, key, batch_mutation, consistency_level)`
+  . `void batch_insert(string keyspace, string key, map<string,list<ColumnOrSuperColumn>> batch_mutation, ConsistencyLevel consistency_level)`
  
- Insert Columns or SuperColumns across different Column Families for the same row key. `batch_mutation` is a `map<string, list<ColumnOrSuperColumn>>` -- a map which pairs column family names with the relevant `ColumnOrSuperColumn` objects to insert.
+ Insert Columns or SuperColumns across different Column Families for the same row key. `batch_mutation` is a `map<string,list<ColumnOrSuperColumn>>` -- a map which pairs column family names with the relevant `ColumnOrSuperColumn` objects to insert.
  
  === batch_mutate ===
  ''Requires Cassandra 0.6''
  
-  . `batch_mutate(keyspace, mutation_map, consistency_level)`
+  . `void batch_mutate(string keyspace, map<string,map<string,list<Mutation>>> mutation_map, ConsistencyLevel consistency_level)`
  
  Executes the specified mutations on the keyspace. `mutation_map` is a `map<string, map<string, list<Mutation>>>`; the outer map maps the key to the inner map, which maps the column family to the `Mutation`; can be read as: `map<key : string, map<column_family : string, list<Mutation>>>`.  To be more specific, the outer map key is a row key, the inner map key is the column family name.
  
  A `Mutation` specifies either columns to insert or columns to delete. See `Mutation` and `Deletion` above for more details.
  
  === remove ===
-  . `remove(keyspace, key, column_path, timestamp, consistency_level)`
+  . `void remove(string keyspace, string key, ColumnPath column_path, i64 timestamp, ConsistencyLevel consistency_level)`
  
  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. Note that the `timestamp` is needed, so that if the commands are replayed in a different order on different nodes, the same result is produced.
  
@@ -334, +334 @@

  === describe_ring ===
  ''Requires Cassandra 0.6''
  
-  . `list<TokenRange> describe_ring(keyspace)`
+  . `list<TokenRange> describe_ring(string keyspace)`
  
  Gets 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.
  
  === describe_keyspace ===
  ''Requires Cassandra 0.6''
  
-  . `map<string, map<string, string>> describe_keyspace(keyspace)`
+  . `map<string, map<string, string>> describe_keyspace(string keyspace)`
  
  Gets information about the specified keyspace.
  
  === truncate ===
  ''Requires Cassandra 0.7''
  
-  . `truncate(column_family)`
+  . `truncate(ColumnFamily column_family)`
  
  Removes all the rows from the given column family.
  
  === system_add_column_family ===
  ''Requires Cassandra 0.7''
  
-  . `string system_add_column_family(cf_def)`
+  . `string system_add_column_family(CFDef cf_def)`
  
  Adds a column family. This method will throw an exception if a column family with the same name is already associated with the keyspace. Returns the new schema version ID.
  
  === system_drop_column_family ===
  ''Requires Cassandra 0.7''
  
-  . `string system_drop_column_family(column_family)`
+  . `string system_drop_column_family(ColumnFamily column_family)`
  
  Drops a column family. Creates a snapshot and then submits a 'graveyard' compaction during which the abandoned files will be deleted. Returns the new schema version ID.
  
  === system_rename_column_family ===
  ''Requires Cassandra 0.7''
  
-  . `string system_rename_column_family(old_name, new_name)`
+  . `string system_rename_column_family(string old_name, string new_name)`
  
  Renames a column family if the new name doesn't collide with an existing column family associated with the same keyspace. This operation blocks while the operating system renames files on disk. Returns the new schema version ID.
  
  === system_add_keyspace ===
  ''Requires Cassandra 0.7''
  
-  . `string system_add_keyspace(ks_def)`
+  . `string system_add_keyspace(KSDef ks_def)`
  
  Creates a new keyspace and any column families defined with it.  Callers '''are not required''' to first create an empty keyspace and then create column families for it.  Returns the new schema version ID.
  
  === system_drop_keyspace ===
  ''Requires Cassandra 0.7''
  
-  . `string system_drop_keyspace(keyspace)`
+  . `string system_drop_keyspace(string keyspace)`
  
  Drops a keyspace. Creates a snapshot and then submits a 'graveyard' compaction during which the abandoned files will be deleted. Returns the new schema version ID.
  
  === system_rename_keyspace ===
  ''Requires Cassandra 0.7''
  
-  . `string system_rename_keyspace(old_name, new_name)`
+  . `string system_rename_keyspace(string old_name, string new_name)`
  
  Renames a keyspace if the new name doesn't collide with an existing keyspace. This operation blocks while the operating system renames files on disk. Returns the new schema version ID.