Representation of a super column family in Cassandra.
Subclasses \phpcassa\ColumnFamily, so those methods are also available.
Methods summary
public
mixed
|
#
get_super_column( string $key, mixed $super_column, phpcassa\ColumnSlice $column_slice = null, mixed[] $column_names = null, ConsistencyLevel $consistency_level = null )
Fetch a single super column.
Fetch a single super column.
Returns an array of the subcolumns in that super column.
Parameters
- $key
string $key row key to fetch
- $super_column
mixed $super_column return only subcolumns of this super column
- $column_slice
phpcassa\ColumnSlice
a slice of subcolumns to fetch, or null
- $column_names
mixed[] $column_names limit the subcolumns fetched to this list
- $consistency_level
ConsistencyLevel $consistency_level affects the guaranteed number of nodes that must respond
before the operation returns
Returns
mixed array(subcolumn_name => subcolumn_value)
|
public
mixed
|
#
multiget_super_column( string[] $keys, mixed $super_column, phpcassa\ColumnSlice $column_slice = null, mixed[] $column_names = null, ConsistencyLevel $consistency_level = null, integer $buffer_size = 16 )
Fetch a super column from multiple rows from this column family.
Fetch a super column from multiple rows from this column family.
The returned array will map directly from keys to the subcolumn array; the
super column layer is omitted.
Parameters
- $keys
string[] $keys row keys to fetch
- $super_column
mixed $super_column return only subcolumns of this super column
- $column_slice
phpcassa\ColumnSlice
a slice of subcolumns to fetch, or null
- $column_names
mixed[] $column_names limit the subcolumns fetched to this list
- $consistency_level
ConsistencyLevel $consistency_level affects the guaranteed number of nodes that must respond
before the operation returns
- $buffer_size
integer $buffer_size the number of keys to multiget at a single time. If your rows are
large, having a high buffer size gives poor performance; if your rows are small,
consider increasing this value.
Returns
mixed array(key => array(subcolumn_name => subcolumn_value))
|
public
integer
|
#
get_subcolumn_count( string $key, mixed $super_column, phpcassa\ColumnSlice $column_slice = null, mixed[] $column_names = null, ConsistencyLevel $consistency_level = null )
Count the number of subcolumns in a supercolumn.
Count the number of subcolumns in a supercolumn.
Parameters
- $key
string $key row to be counted
- $super_column
mixed $super_column count only subcolumns in this super column
- $column_slice
phpcassa\ColumnSlice
a slice of subcolumns to count, or null
- $column_names
mixed[] $column_names limit the possible subcolumns or counted to this list
- $consistency_level
ConsistencyLevel $consistency_level affects the guaranteed number of nodes that must respond
before the operation returns
Returns
integer
|
public
mixed
|
#
multiget_subcolumn_count( string[] $keys, mixed $super_column, phpcassa\ColumnSlice $column_slice = null, mixed[] $column_names = null, ConsistencyLevel $consistency_level = null )
Count the number of subcolumns in a particular super column across a set of
rows.
Count the number of subcolumns in a particular super column across a set of
rows.
Parameters
- $keys
string[] $keys rows to be counted
- $super_column
mixed $super_column count only subcolumns in this super column
- $column_slice
phpcassa\ColumnSlice
a slice of subcolumns to count, or null
- $column_names
mixed[] $column_names limit the possible subcolumns counted to this list
- $consistency_level
ConsistencyLevel $consistency_level affects the guaranteed number of nodes that must respond
before the operation returns
Returns
mixed array(row_key => subcolumn_count)
|
public
phpcassa\Iterator\RangeColumnFamilyIterator
|
#
get_super_column_range( mixed $super_column, mixed $key_start = "", mixed $key_finish = "", integer $row_count = phpcassa\AbstractColumnFamily::DEFAULT_ROW_COUNT , phpcassa\ColumnSlice $column_slice = null, mixed[] $column_names = null, ConsistencyLevel $consistency_level = null, integer $buffer_size = null )
Get an iterator over a particular super column across a range of rows.
Get an iterator over a particular super column across a range of rows.
The returned iterator will return one array per row. This array will look
like array($rowkey, $subcolumns). Note that the super column layer is omitted
from the results.
Parameters
- $super_column
mixed $super_column return only columns in this super column
- $key_start
mixed $key_start fetch rows with a key >= this
- $key_finish
mixed $key_finish fetch rows with a key <= this
- $row_count
integer $row_count limit the number of rows returned to this amount
- $column_slice
phpcassa\ColumnSlice
a slice of subcolumns to fetch, or null
- $column_names
mixed[] $column_names limit the subcolumns fetched to this list
- $consistency_level
ConsistencyLevel $consistency_level affects the guaranteed number of nodes that must respond
before the operation returns
- $buffer_size
integer $buffer_size When calling get_range , the intermediate results need
to be buffered if we are fetching many rows, otherwise the Cassandra server will
overallocate memory and fail. This is the size of that buffer in number of rows.
Returns
|
public
|
#
add( string $key, mixed $super_column, mixed $column, integer $value = 1, ConsistencyLevel $consistency_level = null )
Increment or decrement a counter.
Increment or decrement a counter.
value should be an integer, either positive or negative, to be
added to a counter column. By default, value is 1.
This method is not idempotent. Retrying a failed add may result in a double
count. You should consider using a separate ConnectionPool with retries disabled
for column families with counters.
Only available in Cassandra 0.8.0 and later.
Parameters
- $key
string $key the row to insert or update the columns in
- $super_column
mixed $super_column the super column to use
- $column
mixed $column the column name of the counter
- $value
integer $value the amount to adjust the counter by
- $consistency_level
ConsistencyLevel $consistency_level affects the guaranteed number of nodes that must respond
before the operation returns
|
public
integer
|
#
remove_super_column( string $key, mixed $super_column, mixed[] $subcolumns = null, ConsistencyLevel $consistency_level = null )
Remove a super column from a row or a set of subcolumns from a single super
column.
Remove a super column from a row or a set of subcolumns from a single super
column.
Parameters
- $key
string $key the row to remove columns from
- $super_column
mixed $super_column only remove this super column or its subcolumns
- $subcolumns
mixed[] $subcolumns the subcolumns to remove. If null, the entire supercolumn will be
removed.
- $consistency_level
ConsistencyLevel $consistency_level affects the guaranteed number of nodes that must respond
before the operation returns
Returns
integer the timestamp for the operation
|
public
|
#
remove_counter( string $key, mixed $super_column, mixed $column = null, ConsistencyLevel $consistency_level = null )
Remove a counter at the specified location.
Remove a counter at the specified location.
Note that counters have limited support for deletes: if you remove a counter,
you must wait to issue any following update until the delete has reached all the
nodes and all of them have been fully compacted.
Available in Cassandra 0.8.0 and later.
Parameters
- $key
string $key the key for the row
- $super_column
mixed $super_column the super column the counter is in
- $column
mixed $column the column name of the counter; if left as null, the entire super column
will be removed
- $consistency_level
ConsistencyLevel $consistency_level affects the guaranteed number of nodes that must respond
before the operation returns
Overrides
|