public function __construct($vals = null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array(1 => array('var' => 'message', 'type' => TType::STRING)); } if (is_array($vals)) { if (isset($vals['message'])) { $this->message = $vals['message']; } } }
public function __construct($vals = null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array(1 => array('var' => 'message', 'type' => TType::STRING)); } if (is_array($vals)) { parent::__construct(self::$_TSPEC, $vals); } }
/** * Get an iterator over a range of rows. * * @param string $key_start fetch rows with a key >= this * @param string $key_finish fetch rows with a key <= this * @param int $row_count limit the number of rows returned to this amount * @param mixed[] $columns limit the columns or super columns fetched to this list * @param mixed $column_start only fetch columns with name >= this * @param mixed $column_finish only fetch columns with name <= this * @param bool $column_reversed fetch the columns in reverse order * @param int $column_count limit the number of columns returned to this amount * @param mixed $super_column return only columns in this super column * @param cassandra_ConsistencyLevel $read_consistency_level affects the guaranteed * number of nodes that must respond before the operation returns * @param int $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. * * @return ColumnFamilyIterator */ public function get_range($key_start = "", $key_finish = "", $row_count = self::DEFAULT_ROW_COUNT, $columns = null, $column_start = "", $column_finish = "", $column_reversed = false, $column_count = self::DEFAULT_COLUMN_COUNT, $super_column = null, $read_consistency_level = null, $buffer_size = null) { if ($buffer_size == null) { $buffer_size = $this->buffer_size; } if ($buffer_size < 2) { $ire = new cassandra_InvalidRequestException(); $ire->setMessage('buffer_size cannot be less than 2'); throw $ire; } return new ColumnFamilyIterator($this, $buffer_size, $key_start, $key_finish, $row_count, $columns, $column_start, $column_finish, $column_reversed, $column_count, $super_column, $read_consistency_level); }
/** * Fetch a set of rows from this column family based on an index clause. * * @param cassandra_IndexClause $index_clause limits the keys that are returned based * on expressions that compare the value of a column to a given value. At least * one of the expressions in the IndexClause must be on an indexed column. You * can use the CassandraUtil::create_index_expression() and * CassandraUtil::create_index_clause() methods to help build this. * @param mixed[] $columns limit the columns or super columns fetched to this list * @param mixed $column_start only fetch columns with name >= this * @param mixed $column_finish only fetch columns with name <= this * @param bool $column_reversed fetch the columns in reverse order * @param int $column_count limit the number of columns returned to this amount * @param mixed $super_column return only columns in this super column * @param cassandra_ConsistencyLevel $read_consistency_level affects the guaranteed * number of nodes that must respond before the operation returns * * @return mixed array(row_key => array(column_name => column_value)) */ public function get_indexed_slices($index_clause, $columns = null, $column_start = '', $column_finish = '', $column_reversed = false, $column_count = self::DEFAULT_COLUMN_COUNT, $super_column = null, $read_consistency_level = null, $buffer_size = null) { if ($buffer_size == null) { $buffer_size = $this->buffer_size; } if ($buffer_size < 2) { $ire = new cassandra_InvalidRequestException(); $ire->setMessage('buffer_size cannot be less than 2'); throw $ire; } $new_clause = new cassandra_IndexClause(); foreach ($index_clause->expressions as $expr) { $new_expr = new cassandra_IndexExpression(); $new_expr->value = $this->pack_value($expr->value, $expr->column_name); $new_expr->column_name = $this->pack_name($expr->column_name); $new_expr->op = $expr->op; $new_clause->expressions[] = $new_expr; } $new_clause->start_key = $index_clause->start_key; $new_clause->count = $index_clause->count; $column_parent = $this->create_column_parent($super_column); $predicate = self::create_slice_predicate($columns, $column_start, $column_finish, $column_reversed, $column_count); return new IndexedColumnFamilyIterator($this, $new_clause, $buffer_size, $column_parent, $predicate, $this->rcl($read_consistency_level)); }