libQtCassandra 0.3.2
|
Test to search for columns. More...
#include <QCassandraColumnPredicate.h>
Public Member Functions | |
QCassandraColumnPredicate () | |
Initializes the base class of the column predicate. | |
consistency_level_t | consistencyLevel () const |
Retrieve the consistency level. | |
void | setConsistencyLevel (consistency_level_t consistency_level) |
Set the consistency level. | |
Private Member Functions | |
virtual void | toPredicate (void *data) const |
Transform to a Thrift predicate. | |
Private Attributes | |
consistency_level_t | f_consistency_level |
The consistency level used along this predicate. | |
Friends | |
class | QCassandraPrivate |
The default column predicate returns all the columns defined in your rows. This base class cannot be changed to constrain the list of columns returned by a readCells() or readRows() call.
You may want to consider using a QCassandraColumnRangePredicate or QCassandraColumnNamePredicate instead. However, if you are very likely to read all the columns anyway, it may be faster to just use the QCassandraColumnPredicate and have a single transfer from Cassandra.
Definition at line 57 of file QCassandraColumnPredicate.h.
QtCassandra::QCassandraColumnPredicate::QCassandraColumnPredicate | ( | ) |
When you create a QCassandraColumnPredicate object, you tell the system to return all the columns of the table row you are querying. To only query a given set of columns, use the QCassandraColumnNamePredicate (i.e. specific set of columns) or the QCassandraColumnRangePredicate (i.e. all the columns between the start and end boundaries.)
The information defined in the base are available to both the column name predicate and the column range predicate.
Definition at line 87 of file QCassandraColumnPredicate.cpp.
consistency_level_t QtCassandra::QCassandraColumnPredicate::consistencyLevel | ( | ) | const |
This function returns the current consistency level defined in this column predicate. By default it is set to DEFAULT. You may want to change it with a call to the setConsistencyLevel() function.
To setup the default consistency, see the setConsistencyLevel() function of your QCassandra object.
Definition at line 106 of file QCassandraColumnPredicate.cpp.
References f_consistency_level.
Referenced by QtCassandra::QCassandraPrivate::getCellCount(), and QtCassandra::QCassandraPrivate::getColumnSlice().
void QtCassandra::QCassandraColumnPredicate::setConsistencyLevel | ( | consistency_level_t | consistency_level | ) |
This function changes the consistency level you want to use when you use this predicate.
The consistency levels are probably better on the Cassandra system. The default is ONE and the usual best choice is QUORUM.
[in] | consistency_level | One of the consistency levels. |
Definition at line 123 of file QCassandraColumnPredicate.cpp.
References f_consistency_level.
void QtCassandra::QCassandraColumnPredicate::toPredicate | ( | void * | data | ) | const [private, virtual] |
This function is used to transform a QCassandraColumnPredicate object to a Cassandra SlicePredicate structure.
The input parameter is set to void * because the function is defined in the public header file and thus cannot directly make use of the Thrift type definitions.
[in] | data | The pointer to the SlicePredicate to setup. |
Reimplemented in QtCassandra::QCassandraColumnNamePredicate, and QtCassandra::QCassandraColumnRangePredicate.
Definition at line 139 of file QCassandraColumnPredicate.cpp.
Referenced by QtCassandra::QCassandraPrivate::getCellCount(), and QtCassandra::QCassandraPrivate::getColumnSlice().
friend class QCassandraPrivate [friend] |
Definition at line 68 of file QCassandraColumnPredicate.h.
Whenever accessing the Cassandra server to read or write data, a consistency level is specified. This is the one when you read a list of columns.
Definition at line 70 of file QCassandraColumnPredicate.h.
Referenced by consistencyLevel(), and setConsistencyLevel().
This document is part of the libQtCassandra Project.
Copyright by Made to Order Software Corp.