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/09/30 19:32:47 UTC
[Cassandra Wiki] Update of "API07" by zznate
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for change notification.
The "API07" page has been changed by zznate.
The comment on this change is: Added get_indexed_slices and related structs. Changed string to byte in a couple of places.
http://wiki.apache.org/cassandra/API07?action=diff&rev1=5&rev2=6
--------------------------------------------------
The semantics of start keys and tokens are slightly different. Keys are start-inclusive; tokens are start-exclusive. Token ranges may also wrap -- that is, the end token may be less than the start one. Thus, a range from keyX to keyX is a one-element range, but a range from tokenY to tokenY is the full ring.
||'''Attribute''' ||'''Type''' ||'''Default''' ||'''Required''' ||'''Description''' ||
- ||`start_key` ||`string` ||n/a ||N ||The first key in the inclusive `KeyRange`. ||
+ ||`start_key` ||`binary` ||n/a ||N ||The first key in the inclusive `KeyRange`. ||
- ||`end_key` ||`string` ||n/a ||N ||The last key in the inclusive `KeyRange`. ||
+ ||`end_key` ||`binary` ||n/a ||N ||The last key in the inclusive `KeyRange`. ||
||`start_token` ||`string` ||n/a ||N ||The first token in the exclusive `KeyRange`. ||
||`end_token` ||`string` ||n/a ||N ||The last token in the exclusive `KeyRange`. ||
||`count` ||`i32` ||100 ||Y ||The total number of keys to permit in the `KeyRange`. ||
@@ -141, +141 @@
A `KeySlice` encapsulates a mapping of a key to the slice of columns for it as returned by the get_range_slices operation. Normally, when slicing a single key, a `list<ColumnOrSuperColumn>` of the slice would be returned. When slicing multiple or a range of keys, a `list<KeySlice>` is instead returned so that each slice can be mapped to their key.
||'''Attribute''' ||'''Type''' ||'''Default''' ||'''Required''' ||'''Description''' ||
- ||`key` ||`string` ||n/a ||Y ||The key for the slice. ||
+ ||`key` ||`binary` ||n/a ||Y ||The key for the slice. ||
||`columns` ||`list<ColumnOrSuperColumn>` ||n/a ||Y ||The columns in the slice. ||
+ === IndexOperator ===
+ An enum that details the type of operator to use in an `IndexExpression`. Currently, on `EQ` is supported.
+ ||'''Operator'''||'''Description'''||
+ ||`EQ`|| Equality ||
+ ||`GTE`||Greater than or equal to||
+ ||`GT`|| Greater than||
+ ||`LTE`||Less than or equal to||
+ ||`LT`||Less than||
+
+
+ === IndexExpression ===
+ A struct that defines the `IndexOperator` to use against a column for a lookup value. Used only by the `IndexClause` in the `get_indexed_slices` method.
+ ||'''Attribute''' ||'''Type''' ||'''Default''' ||'''Required''' ||'''Description''' ||
+ ||`column_name` ||`binary` ||n/a ||Y ||The column name to against which the operator and value will be applied ||
+ ||`op` ||`IndexOperator` ||n/a ||Y || The `IndexOperator` to use (currently only `EQ` is supported) ||
+ ||`value` ||`binary` ||n/a ||Y ||The value for which to the column ||
+
+ === IndexClause ===
+ Defines one or more `IndexExpression`s for `get_indexed_slices`
+ ||'''Attribute''' ||'''Type''' ||'''Default''' ||'''Required''' ||'''Description''' ||
+ ||`expressions` ||`list<IndexExpression>` ||n/a ||Y ||The column name to against which the operator and value will be applied ||
+ ||`start_key` ||`binary` ||n/a ||Y || Start the index query at the specified key - can be set to `''`, i.e., an empty byte array, to start with the first key ||
+ ||`count` ||`integer` ||100 ||Y ||The number of results to which the index query will be constrained ||
=== TokenRange ===
@@ -223, +246 @@
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. This method is only allowed when using an order-preserving partitioner.
+ === get_indexed_slices ===
+ . `list<KeySlice> get_indexed_slices(column_parent, index_clause, predicate, consistency_level)`
+
+ Like `get_range_slices`, returns a list of slices, but uses `IndexClause` instead of `KeyRange`. To use this method, the underlying `ColumnFamily` of the `ColumnParent` must have been configured with a column_metadata attribute, specifying at least the name and index_type attributes. See `CfDef` and `ColumnDef` above for the list of attributes.
+
=== insert ===
. `insert(key, column_path, value, timestamp, consistency_level)`