libQtCassandra 0.3.2

QtCassandra::QCassandraColumnPredicate Class Reference

Test to search for columns. More...

#include <QCassandraColumnPredicate.h>

Inheritance diagram for QtCassandra::QCassandraColumnPredicate:
Collaboration diagram for QtCassandra::QCassandraColumnPredicate:

List of all members.

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.


class QCassandraPrivate

Detailed Description

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.

I call the finish column the "end column". Somehow, it makes more sense to me. Plus the row predicate uses the word "end" and not the word "finish". Not only that, the one bound that changes is the start row name when you set the wrap mode to true. So if one bound was to have a different name, it would be the start row name and not the "finish" column of the column predicate.

Definition at line 57 of file QCassandraColumnPredicate.h.

Constructor & Destructor Documentation

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.

Member Function Documentation

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.

The current consistency level.
See also:

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_levelOne of the consistency levels.
See also:

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]dataThe 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().

Friends And Related Function Documentation

friend class QCassandraPrivate [friend]

Definition at line 68 of file QCassandraColumnPredicate.h.

Member Data Documentation

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().

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

This document is part of the libQtCassandra Project.

Copyright by Made to Order Software Corp.