libQtCassandra: QtCassandra::QCassandraTable Class Reference

QtCassandra::QCassandraTable Class Reference

Defines a table and may hold a Cassandra column family definition. More...

#include <include/QtCassandra/QCassandraTable.h>

Inheritance diagram for QtCassandra::QCassandraTable:
Collaboration diagram for QtCassandra::QCassandraTable:

List of all members.

Public Member Functions

virtual ~QCassandraTable ()
 Clean up the QCassandraTable object.

double bloomFilterFPChance () const
 Retrieve the bloom filter probability value.

QString caching () const
 Return the current caching mode.

void clearCache ()
 Clear the memory cache.

QSharedPointer
< QCassandraColumnDefinition
columnDefinition (const QString &column_name)
 Retrieve a column definition by name.

const QCassandraColumnDefinitionscolumnDefinitions () const
 Return the a reference to the column definitions.

QString columnType () const
 Retrieve the current column type.

QString comment () const
 Retrieve the table comment.

QString compactionStrategy () const
 Retrieve the current compaction strategy.

QString compactionStrategyOption (const QString &option_name) const
 Retrieve the value of the specified compaction strategy option.

QString comparatorType () const
 Retrieve the comparator type for this table name.

QString compressionOption (const QString &option_name) const
 Retrieve the value of the specified compression option.

QString contextName () const
 Return the name of the context attached to this table definition.

void create ()
 Create a Cassandra table.

double dcLocalReadRepairChance () const
 Retrieve the current value of the read repair chance.

QString defaultValidationClass () const
 Retrieve the default validation class.

void dropRow (const char *row_name, QCassandraValue::timestamp_mode_t mode=QCassandraValue::TIMESTAMP_MODE_AUTO, int64_t timestamp=0, consistency_level_t consistency_level=CONSISTENCY_LEVEL_ALL)
 Drop the named row.

void dropRow (const wchar_t *row_name, QCassandraValue::timestamp_mode_t mode=QCassandraValue::TIMESTAMP_MODE_AUTO, int64_t timestamp=0, consistency_level_t consistency_level=CONSISTENCY_LEVEL_ALL)
 Drop the named row.

void dropRow (const QString &row_name, QCassandraValue::timestamp_mode_t mode=QCassandraValue::TIMESTAMP_MODE_AUTO, int64_t timestamp=0, consistency_level_t consistency_level=CONSISTENCY_LEVEL_ALL)
 Drop the named row.

void dropRow (const QUuid &row_uuid, QCassandraValue::timestamp_mode_t mode=QCassandraValue::TIMESTAMP_MODE_AUTO, int64_t timestamp=0, consistency_level_t consistency_level=CONSISTENCY_LEVEL_ALL)
 Drop the named row.

void dropRow (const QByteArray &row_key, QCassandraValue::timestamp_mode_t mode=QCassandraValue::TIMESTAMP_MODE_AUTO, int64_t timestamp=0, consistency_level_t consistency_level=CONSISTENCY_LEVEL_ALL)
 Drop the row from the Cassandra database.

bool exists (const char *row_name) const
 Check whether a row exists.

bool exists (const wchar_t *row_name) const
 Check whether a row exists.

bool exists (const QString &row_name) const
 Check whether a row exists.

bool exists (const QUuid &row_uuid) const
 Check whether a row exists.

bool exists (const QByteArray &row_key) const
 Check whether a row exists.

QSharedPointer< QCassandraRowfindRow (const char *row_name) const
 Search for a row.

QSharedPointer< QCassandraRowfindRow (const wchar_t *row_name) const
 Search for a row.

QSharedPointer< QCassandraRowfindRow (const QString &row_name) const
 Search for a row.

QSharedPointer< QCassandraRowfindRow (const QUuid &row_uuid) const
 Search for a row.

QSharedPointer< QCassandraRowfindRow (const QByteArray &row_key) const
 Search for a row.

int32_t gcGraceSeconds () const
 Get the current garbage collect grace period.

bool hasBloomFilterFPChance () const
 Check whether the bloom filter FP chance is defined.

bool hasCaching () const
 Check whether the caching mode is defined.

bool hasColumnType () const
 Check whether the comlumn type is defined.

bool hasComment () const
 Check whether the comment is defined.

bool hasCompactionStrategy () const
 Check whether the compaction strategy is defined.

bool hasCompactionStrategyOption (const QString &option_name) const
 Check whether the compaction strategy option is defined.

bool hasCompactionStrategyOptions () const
 Check whether the compaction strategy has any option defined.

bool hasComparatorType () const
 Check whether the comparator type is defined.

bool hasCompressionOption (const QString &option_name) const
 Check whether the compression option is defined.

bool hasCompressionOptions () const
 Check whether any compression options are defined.

bool hasDCLocalReadRepairChance () const
 Check whether the read repair chance is defined.

bool hasDefaultValidationClass () const
 Check whether the default validation class is defined.

bool hasGcGraceSeconds () const
 Check whether the gc grace seconds is defined.

bool hasIdentifier () const
 Check whether the identifier is defined.

bool hasKeyAlias () const
 Check whether the key alias is defined.

bool hasKeyCacheSavePeriodInSeconds () const
 Check whether the key cache save period in seconds is defined.

bool hasKeyCacheSize () const
 Check whether the key cache size is defined.

bool hasKeyValidationClass () const
 Check whether the key validation class is defined.

bool hasMaxCompactionThreshold () const
 Check whether the maximum compaction threshold is defined.

bool hasMemtableFlushAfterMins () const
 Check whether the memory table flush after minutes is defined.

bool hasMemtableOperationsInMillions () const
 Check whether the memory table operations in millions is defined.

bool hasMemtableThroughputInMb () const
 Check whether the memory table throughput in Mb is defined.

bool hasMergeShardsChance () const
 Check whether the merge shards chance is defined.

bool hasMinCompactionThreshold () const
 Check whether the minimum compaction threshold is defined.

bool hasReadRepairChance () const
 Check whether the read repair chance is defined.

bool hasReplicateOnWrite () const
 Check whether the replicate on write is defined.

bool hasRowCacheKeysToSave () const
 Check whether the row cache keys to save is defined.

bool hasRowCacheProvider () const
 Check whether the row cache provider is defined.

bool hasRowCacheSavePeriodInSeconds () const
 Check whether the row cache save periond in seconds is defined.

bool hasRowCacheSize () const
 Check whether the row cache size is defined.

bool hasSubcomparatorType () const
 Check whether the sub-comparator type is defined.

int32_t identifier () const
 Retrieve the table definition identifier.

QString keyAlias () const
 Retrieve the key alias for this table.

int32_t keyCacheSavePeriodInSeconds () const
 Retrieve the key cache save period.

double keyCacheSize () const
 Get the size of the key cache.

int32_t keyRowCacheKeysToSave () const
 Retrieve the row cache keys to save value.

QString keyValidationClass () const
 Retrieve the current validation class for the table name.

double maxCompactionThreshold () const
 Retrieve the current maximum compaction threshold.

int32_t memtableFlushAfterMins () const
 Retrieve the memory table flush period.

int32_t memtableOperationsInMillions () const
 Retrieve the current number of operations before flushing memory tables.

int32_t memtableThroughputInMb () const
 Get the memtable throughput.

double mergeShardsChance () const
 Return the current merge shards chance value.

double minCompactionThreshold () const
 Retrieve the current minimum compaction threshold.

QCassandraRowoperator[] (const char *row_name)
 Retrieve a table row.

QCassandraRowoperator[] (const wchar_t *row_name)
 Retrieve a table row.

QCassandraRowoperator[] (const QString &row_name)
 Retrieve a table row.

QCassandraRowoperator[] (const QUuid &row_uuid)
 Retrieve a table row.

QCassandraRowoperator[] (const QByteArray &row_key)
 Retrieve a table row.

const QCassandraRowoperator[] (const char *row_name) const
 Retrieve a table row.

const QCassandraRowoperator[] (const wchar_t *row_name) const
 Retrieve a table row.

const QCassandraRowoperator[] (const QString &row_name) const
 Retrieve a table row.

const QCassandraRowoperator[] (const QUuid &row_uuid) const
 Retrieve a table row.

const QCassandraRowoperator[] (const QByteArray &row_key) const
 Retrieve a table row.

double readRepairChance () const
 Retrieve the current value of the read repair chance.

uint32_t readRows (QCassandraRowPredicate &row_predicate)
 Read a set of rows as defined by the row predicate.

bool replicateOnWrite () const
 Retrieve the current status of the replicate on write flag.

QSharedPointer< QCassandraRowrow (const char *row_name)
 Search for a row or create a new one.

QSharedPointer< QCassandraRowrow (const wchar_t *row_name)
 Search for a row or create a new one.

QSharedPointer< QCassandraRowrow (const QString &row_name)
 Search for a row or create a new one.

QSharedPointer< QCassandraRowrow (const QUuid &row_uuid)
 Search for a row or create a new one.

QSharedPointer< QCassandraRowrow (const QByteArray &row_key)
 Search for a row or create a new one.

QString rowCacheProvider () const
 Retrieve the row cache provider.

int32_t rowCacheSavePeriodInSeconds () const
 Retreive the row cache save period.

double rowCacheSize () const
 Retrieve the current row cache size.

const QCassandraRowsrows () const
 Retrieve the entire set of rows defined in this table.

void setBloomFilterFPChance (double chance)
 Define the probability of the bloom filter.

void setCaching (const QString &caching)
 Set the caching mode.

void setColumnType (const QString &column_type)
 Set the column type on this table.

void setComment (QString comment)
 Set the table comment.

void setCompactionStrategy (const QString &compaction_strategy)
 Define the compaction strategy.

void setCompactionStrategyOption (const QString &option_name, const QString &value)
 Define a compaction strategy option.

void setComparatorType (const QString &comparator_type)
 Define the column comparator type.

void setCompressionOption (const QString &option_name, const QString &value)
 Define a compression option.

void setDCLocalReadRepairChance (double repair_chance)
 Set the DC local read repair change value.

void setDefaultValidationClass (const QString &validation_class)
 Set the default validation class.

void setDefaultValidationClassForCounters ()
 Set the default validation class to create a counters table.

void setGcGraceSeconds (int32_t seconds)
 Defines the number of seconds to wait before forced garbage collection.

void setIdentifier (int32_t identifier)
 Define the table identifier.

void setKeyAlias (const QString &key_alias)
 Set the alias for the key.

void setKeyCacheSavePeriodInSeconds (int32_t seconds)
 Define the amount of time the key cache is kept in memory.

void setKeyCacheSize (double size)
 Define the size of the cache key.

void setKeyValidationClass (const QString &validation_class)
 Set the table name validation class.

void setMaxCompactionThreshold (int32_t threshold)
 Set the maximum compaction threshold.

void setMemtableFlushAfterMins (int32_t minutes)
 Set the table flashing period.

void setMemtableOperationsInMillions (int32_t operations)
 Operations limit flush.

void setMemtableThroughputInMb (int32_t megabytes)
 Set the memtable throughput.

void setMergeShardsChance (double merge_shards_chance)
 Set the amount of chance that counters get merged.

void setMinCompactionThreshold (int32_t threshold)
 Set the minimum compaction threshold.

void setReadRepairChance (double repair_chance)
 Set the read repair change value.

void setReplicateOnWrite (bool replicate_on_write)
 Set whether replication occurs on write.

void setRowCacheKeysToSave (int32_t count)
 Define the row keys that should be cached.

void setRowCacheProvider (const QString &provider)
 Set the row cache provider class name.

void setRowCacheSavePeriodInSeconds (int32_t seconds)
 Set the cache save period for rows.

void setRowCacheSize (double size)
 Define the number of rows of this type to cache.

void setSubcomparatorType (const QString &subcomparator_type)
 Set the sub-comparator type.

QString subcomparatorType () const
 Return the current sub-comparator type.

QString tableName () const
 Retrieve the name of this table.

void truncate ()
 Truncate a Cassandra table.

void unsetBloomFilterFPChance ()
 Mark the bloom filter probability as unset.

void unsetCaching ()
 Unset the caching mode.

void unsetColumnType ()
 Unset the column type on this table.

void unsetComment ()
 Unset a comment.

void unsetCompactionStrategy ()
 Unset the operations limit parameter.

void unsetCompactionStrategyOption (const QString &option_name)
 Unset the named compaction strategy option.

void unsetComparatorType ()
 Cancel calls to the setComparatorType() function.

void unsetCompressionOption (const QString &option_name)
 Unset the named compression option.

void unsetDCLocalReadRepairChance ()
 Unset the read repair chance.

void unsetDefaultValidationClass ()
 Unset the default validation class.

void unsetGcGraceSeconds ()
 Unset the garbage collection grace period value.

void unsetIdentifier ()
 Unset the table definition identifier.

void unsetKeyAlias ()
 Unset the alias for the key.

void unsetKeyCacheSavePeriodInSeconds ()
 Unset the effect of calling setKeyCacheSavePeriodInSeconds().

void unsetKeyCacheSize ()
 Unset the key cache size.

void unsetKeyValidationClass ()
 Unset the table name validation class.

void unsetMaxCompactionThreshold ()
 Mark the maximum compaction as unset.

void unsetMemtableFlushAfterMins ()
 Unset the memtable flush period parameter.

void unsetMemtableOperationsInMillions ()
 Unset the operations limit parameter.

void unsetMemtableThroughputInMb ()
 Unset the memtable throughput value.

void unsetMergeShardsChance ()
 Unset the merge shards value.

void unsetMinCompactionThreshold ()
 Mark the minimum compaction as unset.

void unsetReadRepairChance ()
 Unset the read repair chance.

void unsetReplicateOnWrite ()
 Unset the replicate on write flag.

void unsetRowCacheKeysToSave ()
 Mark the row cache keys to save as unset.

void unsetRowCacheProvider ()
 Mark the cache provider class name as unset.

void unsetRowCacheSavePeriodInSeconds ()
 Mark the row cache save period as unset.

void unsetRowCacheSize ()
 Unset the row cache size.

void unsetSubcomparatorType ()
 Unset the sub-comparator type specification.

void update ()
 Update a Cassandra table.

Private Member Functions

 QCassandraTable (QCassandraContext *context, const QString &table_name)
 Initialize a QCassandraTable object.

void addValue (const QByteArray &row_key, const QByteArray &column_key, int64_t value)
 Add a value to a Cassandra counter.

void assignRow (const QByteArray &row_key, const QByteArray &column_key, const QCassandraValue &value)
 Assign a value to a cell in a row of this table.

int32_t getCellCount (const QByteArray &row_key, const QCassandraColumnPredicate &column_predicate)
 Count columns.

void getColumnSlice (const QByteArray &row_key, QCassandraColumnPredicate &column_predicate)
 Read a slice of columns.

bool getValue (const QByteArray &row_key, const QByteArray &column_key, QCassandraValue &value)
 Get a cell value from Cassandra.

void insertValue (const QByteArray &row_key, const QByteArray &column_key, const QCassandraValue &value)
 Save a cell value that changed.

void parseTableDefinition (const void *data)
 This is an internal function used to parse a CfDef structure.

void prepareTableDefinition (void *data) const
 Prepare a table definition.

void remove (const QByteArray &row_key, const QByteArray &column_key, int64_t timestamp, consistency_level_t consistency_level)
 Delete a Cell from a table row.

void setFromCassandra ()
 Mark this table as from Cassandra.

void unparent ()
 This internal function marks the table as unusable.

Private Attributes

QCassandraColumnDefinitions f_column_definitions
 Set of column definitions.

QCassandraContextf_context
 The context that created this table.

controlled_vars::zbool_t f_from_cassandra
 Whether the table is a memory table or a server table.

std::auto_ptr
< QCassandraTablePrivate
f_private
 The table private data: CfDef.

QCassandraRows f_rows
 Set of rows.

Friends

class QCassandraContext
class QCassandraPrivate
class QCassandraRow
class QCassandraTablePrivate

Detailed Description

In Cassandra, a table is called a column family. Mainly because each row in a Cassandra table can have a different set of columns whereas a table is usually viewed as a set of rows that all have the exact same number of columns (but really, even in SQL the set of columns can be viewed as varying since columns can be set to NULL and that has [nearly] the same effect as not defining a column in Cassandra.)

This class defines objects that can hold all the column family information so as to create new ones and read existing ones.

The name of a table is very limited (i.e. letters, digits, and underscores, and the name must start with a letter.) The maximum length is not specified, but it is relatively short as it is used as a filename that will hold the data of the table.

Whenever trying to get a row, the default behavior is to create a new row if it doesn't exist yet. If you need to know whether a row exists, make sure you use the exists() function.

Note:
A table can be created, updated, and dropped. In all those cases, the functions return once the Cassandra instance with which you are connected is ready. However, that is not enough if you are working with a cluster because the other nodes do not get updated instantaneously. Instead, you have to call the QCassandra::synchronizeSchemaVersions() function of the QCassandra object to make sure that the table is fully available across your cluster.
See also:
exists()
QCassandra::synchronizeSchemaVersions()

Definition at line 54 of file QCassandraTable.h.


Constructor & Destructor Documentation

This function ensures that all resources allocated by the QCassandraTable are released.

Note that does not in any way destroy the table in the Cassandra cluster.

Definition at line 210 of file QCassandraTable.cpp.

QtCassandra::QCassandraTable::QCassandraTable ( QCassandraContext context,
const QString &  table_name 
) [private]

This function initializes a QCassandraTable object.

All the parameters are set to the defaults as defined in the Cassandra definition of the CfDef message. You can use the different functions to change the default values.

Note that the context and table name cannot be changed later. These are fixed values that follow the Cassandra behavior.

A table name must be composed of letters (A-Za-z), digits (0-9) and underscores (_). It must start with a letter. The corresponding lexical expression is: /^[A-Za-z][A-Za-z0-9_]*$\/

The length of a table name is also restricted, however it is not specified by Cassandra. I suggest you never use a name of more than 200 letters. The length is apparently limited by the number of characters that can be used to name a file on the file system you are using.

Parameters:
[in]contextThe context where this table definition is created.
[in]table_nameThe name of the table definition being created.

Definition at line 180 of file QCassandraTable.cpp.

References QtCassandra::QCassandraContext::contextName(), and f_private.


Member Function Documentation

void QtCassandra::QCassandraTable::addValue ( const QByteArray &  row_key,
const QByteArray &  column_key,
int64_t  value 
) [private]

This function calls the context addValue() function to add a value to a Cassandra counter.

Parameters:
[in]row_keyThe key used to identify the row.
[in]column_keyThe key used to identify the column.
[in]valueThe value to add to the counter. It may be negative.
Returns:
false when the value was not found in the database, true otherwise

Definition at line 3325 of file QCassandraTable.cpp.

References QtCassandra::QCassandraContext::addValue(), f_context, f_from_cassandra, f_private, and tableName().

Referenced by QtCassandra::QCassandraRow::addValue().

void QtCassandra::QCassandraTable::assignRow ( const QByteArray &  row_key,
const QByteArray &  column_key,
const QCassandraValue value 
) [private]

This function assigns the specified value to a cell in a row of this table. It is an internal function used to save the results of a get_slice() or get_range_slices() function calls.

It also marks the data as coming from Cassandra so it remains cached as expected (i.e. we avoid further reads until the cache gets cleared.)

Parameters:
[in]row_keyThe binary key of the row.
[in]column_keyThe binary key of the cell.
[in]valueThe value to assign to the named cell.

Definition at line 3352 of file QCassandraTable.cpp.

References row().

Referenced by QtCassandra::QCassandraPrivate::getColumnSlice(), and QtCassandra::QCassandraPrivate::getRowSlices().

This function returns the current value of the bloom filter probability. Note that this value is a double.

Since:
Cassandra version 1.0.0.
See also:
http://wiki.apache.org/cassandra/ArchitectureOverview#Write_path
Returns:
The number of seconds before saving the cache.

Definition at line 1195 of file QCassandraTable.cpp.

References f_private.

This function retrieves the caching mode and return its name. If no caching is defined, an empty string is returned ("").

Since:
Cassandra 1.1.0
Returns:
The caching or an empty string.

Definition at line 825 of file QCassandraTable.cpp.

References f_private.

This function clears the memory cache. This means all the rows and their cells will be deleted from this table. The memory cache doesn't affect the Cassandra database.

After a clear, you can retrieve fresh data (i.e. by directly loading the data from the Cassandra database.)

Note that if you kept shared pointers to rows and cells defined in this table, accessing those is likely going to generate an exception.

Definition at line 2398 of file QCassandraTable.cpp.

References f_rows.

Referenced by truncate(), and unparent().

QSharedPointer< QCassandraColumnDefinition > QtCassandra::QCassandraTable::columnDefinition ( const QString &  column_name)

This function is used to retrieve a column definition by name. If the column doesn't exist, it gets created.

You can test whether the result is null with the isNull() function of the QSharedPointer class.

Parameters:
[in]column_nameThe name of the column definition to retrieve.
Returns:
A shared pointer to the table found or a null shared pointer.

Definition at line 749 of file QCassandraTable.cpp.

References f_column_definitions.

Referenced by parseTableDefinition().

This function gives you direct access to the internal map of column definitions to avoid a copy of the map. Note that if you change the definitions in any way, this map may become invalid. To be safe, it is wise to make a copy.

The map is indexed by column names.

Returns:
A reference to the internal map of column definitions.

Definition at line 774 of file QCassandraTable.cpp.

References f_column_definitions.

This function returns the current column type of this table definition.

Returns:
The named type of the table definition column.

Definition at line 400 of file QCassandraTable.cpp.

References f_private.

This function retrieves the comment assigned to this table.

Returns:
A string with the table definition comment.
See also:
unsetComment()
setComment()

Definition at line 347 of file QCassandraTable.cpp.

References f_private.

This function returns the current compaction strategy used for this table.

Since:
Cassandra version 1.0.0.
Returns:
The compaction strategy.

Definition at line 1858 of file QCassandraTable.cpp.

References f_private.

QString QtCassandra::QCassandraTable::compactionStrategyOption ( const QString &  option_name) const

This function returns the value of the named compaction strategy option.

If the option is still undefined, the function returns an empty string ("").

Since:
Cassandra version 1.0.0.
Parameters:
[in]option_nameThe name of the compaction strategy option to retrieve.
Returns:
The value of the specfied compaction strategy option.

Definition at line 1935 of file QCassandraTable.cpp.

References f_private.

This function returns a copy of the comparator type.

Returns:
The comparator type.

Definition at line 676 of file QCassandraTable.cpp.

References f_private.

QString QtCassandra::QCassandraTable::compressionOption ( const QString &  option_name) const

This function returns the value of the named compression option.

If the option is still undefined, the function returns an empty string ("").

Since:
Cassandra version 1.0.0.
Parameters:
[in]option_nameThe name of the compression option to retrieve.
Returns:
The value of the specfied compression option.

Definition at line 2011 of file QCassandraTable.cpp.

References f_private.

This function returns the name of the context attached to this table definition.

Note that it is not possible to rename a context and therefore this name will never change.

To get a pointer to the context, use the cluster function context() with this name. Since each context is unique, it will always return the correct pointer.

Returns:
The name of the context this table definition is defined in.

Definition at line 228 of file QCassandraTable.cpp.

References f_private.

This function creates a Cassandra table in the context as specified when you created the QCassandraTable object.

If you want to declare a set of columns, this is a good time to do it too (there is not QColumnDefinition::create() function!) By default, columns use the default validation type as defined using the setComparatorType() for their name and the setDefaultValidationClass() for their data. It is not required to define any column. In that case they all make use of the exact same data.

The table cannot already exist or an error will be thrown by the Cassandra server. If the table is being updated, use the update() function instead.

Note that when you create a new context, you can create its tables at once by defining tables before calling the QCassandraContext::create() function.

Creating a new QCassandraTable:

 QSharedPointer<QtCassandra::QCassandraTable> table(context->table("qt_cassandra_test_table"));
 table->setComment("Our test table.");
 table->setColumnType("Standard"); // Standard or Super
 table->setKeyValidationClass("BytesType");
 table->setDefaultValidationClass("BytesType");
 table->setComparatorType("BytesType");
 table->setKeyCacheSavePeriodInSeconds(14400); // unused in 1.1+
 table->setMemtableFlushAfterMins(60); // unused in 1.1+
 // Memtable defaults are dynamic and usually a better bet
 //table->setMemtableThroughputInMb(247); // unused in 1.1+
 //table->setMemtableOperationsInMillions(1.1578125); // unused in 1.1+
 table->setGcGraceSeconds(864000);
 table->setMinCompactionThreshold(4);
 table->setMaxCompactionThreshold(22);
 table->setReplicateOnWrite(1);
 table->create();
Note:
Once the table->create(); function returns, the table was created in the Cassandra node you are connect with, but it was not yet replicated. In order to use the table, the replication needs to be complete. To know once it is complete, call the QCassandra::synchronizeSchemaVersions() function. If you are to create multiple tables, you can create all the tables at once, then synchronize them all at once which should give time for the Cassandra nodes to replicate the first few tables while you create the last few.
See also:
update()
QCassandraContext::create()
QCassandra::synchronizeSchemaVersions()

Definition at line 2337 of file QCassandraTable.cpp.

References QtCassandra::QCassandraContext::createTable(), f_context, and f_from_cassandra.

This function returns the read repair chance value.

Since:
Cassandra version 1.1.0.
Returns:
The read repair chance value.

Definition at line 1293 of file QCassandraTable.cpp.

References f_private.

This function retrieves the default validation class for the columns of this table.

Returns:
The validation class name.

Definition at line 467 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::dropRow ( const char *  row_name,
QCassandraValue::timestamp_mode_t  mode = QCassandraValue::TIMESTAMP_MODE_AUTO,
int64_t  timestamp = 0,
consistency_level_t  consistency_level = CONSISTENCY_LEVEL_ALL 
)

This function is the same as the dropRow() that takes a row_key parameter. It simply transforms the row name into a row key and calls that other function.

Parameters:
[in]row_nameSpecify the name of the row to drop.
[in]modeSpecify the timestamp mode.
[in]timestampSpecify the timestamp to remove only rows that are have that timestamp or are older.
[in]consistency_levelSpecify the timestamp to remove only rows that are have that timestamp or are older.

Definition at line 3097 of file QCassandraTable.cpp.

Referenced by dropRow().

void QtCassandra::QCassandraTable::dropRow ( const wchar_t *  row_name,
QCassandraValue::timestamp_mode_t  mode = QCassandraValue::TIMESTAMP_MODE_AUTO,
int64_t  timestamp = 0,
consistency_level_t  consistency_level = CONSISTENCY_LEVEL_ALL 
)

This function is the same as the dropRow() that takes a row_key parameter. It simply transforms the row name into a row key and calls that other function.

Parameters:
[in]row_nameSpecify the name of the row to drop.
[in]modeSpecify the timestamp mode.
[in]timestampSpecify the timestamp to remove only rows that are have that timestamp or are older.
[in]consistency_levelSpecify the timestamp to remove only rows that are have that timestamp or are older.

Definition at line 3113 of file QCassandraTable.cpp.

References dropRow().

void QtCassandra::QCassandraTable::dropRow ( const QString &  row_name,
QCassandraValue::timestamp_mode_t  mode = QCassandraValue::TIMESTAMP_MODE_AUTO,
int64_t  timestamp = 0,
consistency_level_t  consistency_level = CONSISTENCY_LEVEL_ALL 
)

This function is the same as the dropRow() that takes a row_key parameter. It simply transforms the row name into a row key and calls that other function.

Parameters:
[in]row_nameSpecify the name of the row to drop.
[in]modeSpecify the timestamp mode.
[in]timestampSpecify the timestamp to remove only rows that are have that timestamp or are older.
[in]consistency_levelSpecify the timestamp to remove only rows that are have that timestamp or are older.

Definition at line 3129 of file QCassandraTable.cpp.

References dropRow().

void QtCassandra::QCassandraTable::dropRow ( const QUuid &  row_uuid,
QCassandraValue::timestamp_mode_t  mode = QCassandraValue::TIMESTAMP_MODE_AUTO,
int64_t  timestamp = 0,
consistency_level_t  consistency_level = CONSISTENCY_LEVEL_ALL 
)

This function is the same as the dropRow() that takes a row_key parameter. It simply transforms the row UUID into a row key and calls that other function.

Parameters:
[in]row_uuidSpecify the UUID of the row to drop.
[in]modeSpecify the timestamp mode.
[in]timestampSpecify the timestamp to remove only rows that are have that timestamp or are older.
[in]consistency_levelSpecify the timestamp to remove only rows that are have that timestamp or are older.

Definition at line 3145 of file QCassandraTable.cpp.

References dropRow().

void QtCassandra::QCassandraTable::dropRow ( const QByteArray &  row_key,
QCassandraValue::timestamp_mode_t  mode = QCassandraValue::TIMESTAMP_MODE_AUTO,
int64_t  timestamp = 0,
consistency_level_t  consistency_level = CONSISTENCY_LEVEL_ALL 
)

This function deletes the specified row and its data from the Cassandra database and from memory.

In regard to getting the row deleted from memory, you are expected to use a weak pointer as follow:

 ...
 {
     QWeakPointer<QtCassandra::QCassandraRow> row(table.row(row_key)));
     ...
     table.dropRow(row_key);
 }
 ...

Note that Cassandra doesn't actually remove the row from its database until the next time it does a garbage collection. Still, if there is a row you do not need, drop it.

The timestamp mode can be set to QCassandraValue::TIMESTAMP_MODE_DEFINED in which case the value defined in the timestamp parameter is used by the Cassandra remove() function.

By default the mode parameter is set to QCassandraValue::TIMESTAMP_MODE_AUTO which means that we'll make use of the current time (i.e. only a row created after this call will exist.)

The consistency level is set to CONSISTENCY_LEVEL_ALL since you are likely willing to delete the row on all the nodes. However, I'm not certain this is the best choice here. So the default may change in the future. You may specify CONSISTENCY_LEVEL_DEFAULT in which case the QCassandra object default is used.

Warning:
Remember that a row doesn't actually get removed from the Cassandra database until the next Garbage Collection runs. This is important for all your data centers to be properly refreshed. This also means a readRows() will continue to return the deleted row unless you check for a specific column that has to exist. In that case, the row is not returned since all the columns ARE deleted (or at least hidden in some way.) This function could be called truncate(), however, all empty rows are really removed at some point.
After a row was dropped, you cannot use the row object anymore, even if you kept a shared pointer to it. Calling functions of a dropped row is likely to get you a run-time exception. Note that all the cells defined in the row are also dropped and are also likely to generate a run-time exception if you kept a shared pointer on any one of them.
Parameters:
[in]row_keySpecify the key of the row.
[in]modeSpecify the timestamp mode.
[in]timestampSpecify the timestamp to remove only rows that are have that timestamp or are older.
[in]consistency_levelSpecify the consistency of the row removal across your clusters.

Definition at line 3207 of file QCassandraTable.cpp.

References f_rows, row(), QtCassandra::QCassandra::timeofday(), QtCassandra::QCassandraValue::TIMESTAMP_MODE_AUTO, and QtCassandra::QCassandraValue::TIMESTAMP_MODE_DEFINED.

bool QtCassandra::QCassandraTable::exists ( const char *  row_name) const

This function checks whether the named row exists.

Parameters:
[in]row_nameThe row name to transform to UTF-8.
Returns:
true if the row exists in memory or the Cassandra database.

Definition at line 2759 of file QCassandraTable.cpp.

Referenced by exists().

bool QtCassandra::QCassandraTable::exists ( const wchar_t *  row_name) const

This function checks whether the named row exists.

Parameters:
[in]row_nameThe row name to transform to UTF-8.
Returns:
true if the row exists in memory or the Cassandra database.

Definition at line 2772 of file QCassandraTable.cpp.

References exists().

bool QtCassandra::QCassandraTable::exists ( const QString &  row_name) const

This function checks whether the named row exists.

Parameters:
[in]row_nameThe row name to transform to UTF-8.
Returns:
true if the row exists in memory or the Cassandra database.

Definition at line 2785 of file QCassandraTable.cpp.

References exists().

bool QtCassandra::QCassandraTable::exists ( const QUuid &  row_uuid) const

This function checks whether the named row exists.

Parameters:
[in]row_uuidThe row name in the form of a UUID.
Returns:
true if the row exists in memory or the Cassandra database.

Definition at line 2798 of file QCassandraTable.cpp.

References exists().

bool QtCassandra::QCassandraTable::exists ( const QByteArray &  row_key) const

This function checks whether a row exists. First it checks whether it exists in memory. If not, then it checks in the Cassandra database.

Empty keys are always viewed as non-existant and this function returns false in that case.

Todo:
At this time there isn't a way to specify the consistency level of the calls used by this function. The QCassandra default is used.
Parameters:
[in]row_keyThe binary key of the row to check for.
Returns:
true if the row exists in memory or in Cassandra.

Definition at line 2819 of file QCassandraTable.cpp.

References f_rows, readRows(), QtCassandra::QCassandraRowPredicate::setColumnPredicate(), QtCassandra::QCassandraRowPredicate::setEndRowKey(), QtCassandra::setInt32Value(), and QtCassandra::QCassandraRowPredicate::setStartRowKey().

QSharedPointer< QCassandraRow > QtCassandra::QCassandraTable::findRow ( const char *  row_name) const

This function searches for a row. If it doesn't exist, then a NULL pointer is returned (use the .isNull() function on the shared pointer.)

The function can be used to check whether a given row was already created in memory without actually creating it.

This function accepts a row name viewed as a UTF-8 string.

Warning:
This function does NOT attempt to read the row from the Cassandra database system. It only checks whether the row already exists in memory. To check whether the row exists in the database, use the exists() function instead.
Parameters:
[in]row_nameThe name of the row to check for.
Returns:
A shared pointer to the row, may be NULL (isNull() returning true)
See also:
exists()
row()

Definition at line 2631 of file QCassandraTable.cpp.

Referenced by findRow(), and operator[]().

QSharedPointer< QCassandraRow > QtCassandra::QCassandraTable::findRow ( const wchar_t *  row_name) const

This function searches for a row. If it doesn't exist, then a NULL pointer is returned (use the .isNull() function on the shared pointer.)

The function can be used to check whether a given row was already created in memory without actually creating it.

This function accepts a row name viewed as a UCS-4 string (most Unix) or a UCS-2 string (MS-Windows). If you have a UTF-16 string, make sure to use QString::fromUtf16() instead.

Warning:
This function does NOT attempt to read the row from the Cassandra database system. It only checks whether the row already exists in memory. To check whether the row exists in the database, use the exists() function instead.
Parameters:
[in]row_nameThe name of the row to check for.
Returns:
A shared pointer to the row, may be NULL (isNull() returning true)
See also:
exists()
row()

Definition at line 2660 of file QCassandraTable.cpp.

References findRow().

QSharedPointer< QCassandraRow > QtCassandra::QCassandraTable::findRow ( const QString &  row_name) const

This function searches for a row. If it doesn't exist, then a NULL pointer is returned (use the .isNull() function on the shared pointer.)

The function can be used to check whether a given row was already created in memory without actually creating it.

This function accepts a row name viewed as a UTF-8 string.

Warning:
This function does NOT attempt to read the row from the Cassandra database system. It only checks whether the row already exists in memory. To check whether the row exists in the database, use the exists() function instead.
Parameters:
[in]row_nameThe name of the row to check for.
Returns:
A shared pointer to the row, may be NULL (isNull() returning true)
See also:
exists()
row()

Definition at line 2687 of file QCassandraTable.cpp.

References findRow().

QSharedPointer< QCassandraRow > QtCassandra::QCassandraTable::findRow ( const QUuid &  row_uuid) const

This function searches for a row. If it doesn't exist, then a NULL pointer is returned (use the .isNull() function on the shared pointer.)

The function can be used to check whether a given row was already created in memory without actually creating it.

This function accepts a row uuid viewed as a binary UUID code.

Warning:
This function does NOT attempt to read the row from the Cassandra database system. It only checks whether the row already exists in memory. To check whether the row exists in the database, use the exists() function instead.
Parameters:
[in]row_uuidThe uuid of the row to check for.
Returns:
A shared pointer to the row, may be NULL (isNull() returning true)
See also:
exists()
row()

Definition at line 2714 of file QCassandraTable.cpp.

References findRow().

QSharedPointer< QCassandraRow > QtCassandra::QCassandraTable::findRow ( const QByteArray &  row_key) const

This function searches for a row. If it doesn't exist, then a NULL pointer is returned (use the .isNull() function on the shared pointer.)

The function can be used to check whether a given row was already created in memory without actually creating it.

This function accepts a row key which is a binary buffer.

Warning:
This function does NOT attempt to read the row from the Cassandra database system. It only checks whether the row already exists in memory. To check whether the row exists in the database, use the exists() function instead.
Parameters:
[in]row_keyThe binary key of the row to search for.
Returns:
A shared pointer to the row, may be NULL (isNull() returning true)
See also:
exists()
row()

Definition at line 2741 of file QCassandraTable.cpp.

References f_rows.

This value is used by the Cassandra system to force garbage collection tombstones removals.

Returns:
The number of seconds to wait before each garbage collection recollections.

Definition at line 1518 of file QCassandraTable.cpp.

References f_private.

int32_t QtCassandra::QCassandraTable::getCellCount ( const QByteArray &  row_key,
const QCassandraColumnPredicate column_predicate 
) [private]

This function counts a the number of columns that match a specified column_predicate.

Parameters:
[in]row_keyThe row for which this data is being counted.
[in]column_predicateThe predicate to use to count the cells.
Returns:
The number of columns in this row.

Definition at line 3369 of file QCassandraTable.cpp.

References f_context, f_from_cassandra, f_rows, QtCassandra::QCassandraContext::getCellCount(), and tableName().

Referenced by QtCassandra::QCassandraRow::cellCount().

void QtCassandra::QCassandraTable::getColumnSlice ( const QByteArray &  row_key,
QCassandraColumnPredicate column_predicate 
) [private]

This function reads a slice of columns as specified in the column_predicate.

Note that the column_predicate parameter is an [in,out] because when the setIndex() function is called on the predicate, then this function saves the name of the last column read as the start column of the predicate. This allows you to read all the columns by repititively calling readRows() of your row object.

Parameters:
[in]row_keyThe row for which this data is being read.
[in,out]column_predicateThe predicate to use to read the cells.

Definition at line 3395 of file QCassandraTable.cpp.

References f_context, f_from_cassandra, and QtCassandra::QCassandraContext::getColumnSlice().

Referenced by QtCassandra::QCassandraRow::readCells().

bool QtCassandra::QCassandraTable::getValue ( const QByteArray &  row_key,
const QByteArray &  column_key,
QCassandraValue value 
) [private]

This function calls the context getValue() function to retrieve a value from Cassandra.

The value parameter is not modified unless some data can be retrieved from Cassandra.

Parameters:
[in]row_keyThe key used to identify the row.
[in]column_keyThe key used to identify the column.
[out]valueThe new value of the cell.
Returns:
false when the value was not found in the database, true otherwise

Definition at line 3298 of file QCassandraTable.cpp.

References f_context, f_from_cassandra, f_private, QtCassandra::QCassandraContext::getCounter(), QtCassandra::QCassandraContext::getValue(), and tableName().

Referenced by QtCassandra::QCassandraRow::exists(), and QtCassandra::QCassandraRow::getValue().

This function retrieves the current status of the bloom filter FP chance parameter.

Returns:
True if the bloom filter FP chance parameter is defined.

Definition at line 1179 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the caching parameter.

Returns:
True if the caching parameter is defined.

Definition at line 810 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the comlumn type parameter.

Returns:
True if the comlumn type parameter is defined.

Definition at line 389 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the comment parameter.

Returns:
True if the comment parameter is defined.

Definition at line 333 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the compaction strategy parameter.

Returns:
True if the compaction strategy parameter is defined.

Definition at line 1845 of file QCassandraTable.cpp.

References f_private.

bool QtCassandra::QCassandraTable::hasCompactionStrategyOption ( const QString &  option_name) const

This function retrieves the current status of the compaction strategy option parameter.

Parameters:
[in]option_nameThe name of the compaction strategy option to check for.
Returns:
True if the compaction strategy option parameter is defined.

Definition at line 1906 of file QCassandraTable.cpp.

References f_private.

This function returns true if there is at least one compaction strategy option defined.

Returns:
True if there is at least one compaction strategy option defined.

Definition at line 1918 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the comparator type parameter.

Returns:
True if the comparator type parameter is defined.

Definition at line 665 of file QCassandraTable.cpp.

References f_private.

bool QtCassandra::QCassandraTable::hasCompressionOption ( const QString &  option_name) const

This function retrieves the current status of the specified compression option parameter.

Parameters:
[in]option_nameCheck whether the named compression option is defined.
Returns:
true if the specified compression option is defined.

Definition at line 1983 of file QCassandraTable.cpp.

References f_private.

This function checks whether the array of compression options is empty or not.

Returns:
true if at least one compression parameter is defined.

Definition at line 1994 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the read repair chance parameter.

Since:
Cassandra version 1.1.0.
Returns:
True if the read repair chance parameter is defined.

Definition at line 1280 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the default validation class parameter.

Returns:
True if the default validation class parameter is defined.

Definition at line 455 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the gc grace seconds parameter.

Returns:
True if the gc grace seconds parameter is defined.

Definition at line 1506 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the identifier parameter.

Returns:
True if the identifier parameter is defined.

Definition at line 282 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the key alias parameter.

Returns:
True if the key alias parameter is defined.

Definition at line 559 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the key cache save period in seconds parameter.

Returns:
True if the key cache save period in seconds parameter is defined.

Definition at line 1055 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the key cache size parameter.

Returns:
True if the key cache size parameter is defined.

Definition at line 994 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the key validation class parameter.

Returns:
True if the key validation class parameter is defined.

Definition at line 510 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the maximum compaction threshold parameter.

Returns:
True if the maximum compaction threshold parameter is defined.

Definition at line 1793 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the memory table flush after minutes parameter.

Returns:
True if the memory table flush after minutes parameter is defined.

Definition at line 1567 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the memory table operations in millions parameter.

Returns:
True if the memory table operations in millions parameter is defined.

Definition at line 1684 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the memory table throughput in Mb parameter.

Returns:
True if the memory table throughput in Mb parameter is defined.

Definition at line 1629 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the merge shards chance parameter.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
True if the merge shards chance parameter is defined.

Definition at line 1391 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the minimum compaction threshold parameter.

Returns:
True if the minimum compaction threshold parameter is defined.

Definition at line 1743 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the read repair chance parameter.

Returns:
True if the read repair chance parameter is defined.

Definition at line 1229 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the replicate on write parameter.

Returns:
True if the replicate on write parameter is defined.

Definition at line 1330 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the row cache keys to save parameter.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
True if the row cache keys to save parameter is defined.

Definition at line 1117 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the row cache provider parameter.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
True if the row cache provider parameter is defined.

Definition at line 1451 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the row save periond in seconds size parameter.

Returns:
True if the row cache save periond in seconds parameter is defined.

Definition at line 933 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the row cache size parameter.

Returns:
True if the row cache size parameter is defined.

Definition at line 874 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current status of the sub-comparator type parameter.

Returns:
True if the sub-comparator type parameter is defined.

Definition at line 716 of file QCassandraTable.cpp.

References f_private.

Each table is identified by a unique number. This function returns that unique number.

If somehow undefined, the function returns zero.

Returns:
The table identifier.

Definition at line 296 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::insertValue ( const QByteArray &  row_key,
const QByteArray &  column_key,
const QCassandraValue value 
) [private]

This function calls the context insertValue() function to save the new value that was defined in a cell.

Parameters:
[in]row_keyThe key used to identify the row.
[in]column_keyThe key used to identify the column.
[in]valueThe new value of the cell.

Definition at line 3239 of file QCassandraTable.cpp.

References QtCassandra::QCassandraContext::addValue(), f_context, f_from_cassandra, f_private, QtCassandra::QCassandraContext::getCounter(), QtCassandra::QCassandraContext::insertValue(), QtCassandra::QCassandraValue::int16Value(), QtCassandra::QCassandraValue::int32Value(), QtCassandra::QCassandraValue::int64Value(), QtCassandra::QCassandraValue::signedCharValue(), QtCassandra::QCassandraValue::size(), and tableName().

Referenced by QtCassandra::QCassandraRow::insertValue().

This function returns the alias of this table name.

This is only used by CQL at this point.

Returns:
The key alias.
See also:
unsetKeyAlias()
setKeyAlias()

Definition at line 575 of file QCassandraTable.cpp.

References f_private.

This function returns the current number of seconds the cache should be retained in memory.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
The number of seconds before saving the cache.

Definition at line 1070 of file QCassandraTable.cpp.

References f_private.

This function returns the definition of the key cache.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
Cache size either as a % value (1.0 or less) or a Mb value (over 1.0)

Definition at line 1008 of file QCassandraTable.cpp.

References f_private.

This function returns the current value of the row cache keys to save.

Since:
Cassandra version 1.0.0.
Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
The number of seconds before saving the cache.

Definition at line 1133 of file QCassandraTable.cpp.

References f_private.

This function returns the current validation class for the table name.

Returns:
The current validation class for the table name.

Definition at line 521 of file QCassandraTable.cpp.

References f_private.

This function retrieves the current maximum compaction threshold.

Returns:
The maximum compaction threshold for this table.
See also:
setMaxCompactionThreshold()
unsetMaxCompactionThreshold()

Definition at line 1807 of file QCassandraTable.cpp.

References f_private.

This function reads the number of minutes to wait before forcing a flush of a table from memory. A table that is not being accessed for that long gets removed.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
The number of minutes a cached table will be kept.

Definition at line 1583 of file QCassandraTable.cpp.

References f_private.

This function returns the current number of operations to perform on memory tables for this table before they get flushed.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
The number of operations in millions before a flush occurs.

Definition at line 1699 of file QCassandraTable.cpp.

References f_private.

This function retrieve the current memtable throughput in megabytes.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
The memtable throughput in megabytes.

Definition at line 1643 of file QCassandraTable.cpp.

References f_private.

This function returns the chance the system will merge counter shards.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
The chance the system will merge counter shards.

Definition at line 1406 of file QCassandraTable.cpp.

References f_private.

This function reads the minimum compaction threshold.

Returns:
The minimum compaction threshold of this table.

Definition at line 1754 of file QCassandraTable.cpp.

References f_private.

QCassandraRow & QtCassandra::QCassandraTable::operator[] ( const char *  row_name)

This function retrieves a table row. If the named row doesn't exist yet, then it is created first.

The reference is writable so you make write to a cell in this row.

This function accepts a UTF-8 name for this row reference.

Parameters:
[in]row_nameThe name of the row to retrieve.
Returns:
A reference to a QCassandraRow.

Definition at line 2866 of file QCassandraTable.cpp.

References row().

QCassandraRow & QtCassandra::QCassandraTable::operator[] ( const wchar_t *  row_name)

This function retrieves a table row. If the named row doesn't exist yet, then it is created first.

The reference is writable so you make write to a cell in this row.

This function accepts a UCS-4 (Unix) or UCS-2 (MS-Windows) name for this row reference.

Parameters:
[in]row_nameThe name of the row to retrieve.
Returns:
A reference to a QCassandraRow.

Definition at line 2886 of file QCassandraTable.cpp.

References row().

QCassandraRow & QtCassandra::QCassandraTable::operator[] ( const QString &  row_name)

This function retrieves a table row. If the named row doesn't exist yet, then it is created first.

The reference is writable so you make write to a cell in this row.

This function accepts a UTF-8 name for this row reference.

Parameters:
[in]row_nameThe name of the row to retrieve.
Returns:
A reference to a QCassandraRow.

Definition at line 2905 of file QCassandraTable.cpp.

References row().

QCassandraRow & QtCassandra::QCassandraTable::operator[] ( const QUuid &  row_uuid)

This function retrieves a table row. If the named row doesn't exist yet, then it is created first.

The reference is writable so you make write to a cell in this row.

This function accepts a UUID as the name of this row.

Parameters:
[in]row_uuidThe name of the row to retrieve as a UUID.
Returns:
A reference to a QCassandraRow.

Definition at line 2924 of file QCassandraTable.cpp.

References row().

QCassandraRow & QtCassandra::QCassandraTable::operator[] ( const QByteArray &  row_key)

This function retrieves a table row. If the keyed row doesn't exist yet, then it is created first.

The reference is writable so you make write to a cell in this row.

This function accepts a binary key for this row reference.

Parameters:
[in]row_keyThe binary key of the row to retrieve.
Returns:
A reference to a QCassandraRow.

Definition at line 2943 of file QCassandraTable.cpp.

References row().

const QCassandraRow & QtCassandra::QCassandraTable::operator[] ( const char *  row_name) const

This function retrieves a table row. If the named row doesn't exist yet, then the function raises an error.

The reference is read-only (constant) so you may retrieve a cell value from it, but not modify the cell.

This function accepts a name as the row reference. The name is viewed as a UTF-8 string.

Exceptions:
std::runtime_errorThe function checks whether the named row exists. If not, then this error is raised because the function is constant and cannot create a new row.
Parameters:
[in]row_nameThe name of the row to retrieve.
Returns:
A constant reference to a QCassandraRow.

Definition at line 2968 of file QCassandraTable.cpp.

References findRow(), and row().

const QCassandraRow & QtCassandra::QCassandraTable::operator[] ( const wchar_t *  row_name) const

This function retrieves a table row. If the named row doesn't exist yet, then the function raises an error.

The reference is read-only (constant) so you may retrieve a cell value from it, but not modify the cell.

This function accepts a name as the row reference. The name is viewed as a UCS-4 (most Unix) or UCS-2 (MS-Windows) string.

Exceptions:
std::runtime_errorThe function checks whether the named row exists. If not, then this error is raised because the function is constant and cannot create a new row.
Parameters:
[in]row_nameThe name of the row to retrieve.
Returns:
A constant reference to a QCassandraRow.

Definition at line 2996 of file QCassandraTable.cpp.

References findRow(), and row().

const QCassandraRow & QtCassandra::QCassandraTable::operator[] ( const QString &  row_name) const

This function retrieves a table row. If the named row doesn't exist yet, then the function raises an error.

The reference is read-only (constant) so you may retrieve a cell value from it, but not modify the cell.

This function accepts a name as the row reference.

Exceptions:
std::runtime_errorThe function checks whether the named row exists. If not, then this error is raised because the function is constant and cannot create a new row.
Parameters:
[in]row_nameThe name of the row to retrieve.
Returns:
A constant reference to a QCassandraRow.

Definition at line 3023 of file QCassandraTable.cpp.

References findRow(), and row().

const QCassandraRow & QtCassandra::QCassandraTable::operator[] ( const QUuid &  row_uuid) const

This function retrieves a table row. If the named row doesn't exist yet, then the function raises an error.

The reference is read-only (constant) so you may retrieve a cell value from it, but not modify the cell.

This function accepts a name as the row reference.

Exceptions:
std::runtime_errorThe function checks whether the named row exists. If not, then this error is raised because the function is constant and cannot create a new row.
Parameters:
[in]row_uuidThe name of the row to retrieve as a UUID.
Returns:
A constant reference to a QCassandraRow.

Definition at line 3050 of file QCassandraTable.cpp.

References findRow(), and row().

const QCassandraRow & QtCassandra::QCassandraTable::operator[] ( const QByteArray &  row_key) const

This function retrieves a table row. If the named row doesn't exist yet, then the function raises an error.

The reference is read-only (constant) so you may retrieve a cell value from it, but not modify the cell.

This function accepts a binary key as the row reference.

Exceptions:
std::runtime_errorThe function checks whether the named row exists. If not, then this error is raised because the function is constant and cannot create a new row.
Parameters:
[in]row_keyThe binary key of the row to retrieve.
Returns:
A constant reference to a QCassandraRow.

Definition at line 3077 of file QCassandraTable.cpp.

References findRow(), and row().

void QtCassandra::QCassandraTable::parseTableDefinition ( const void *  data) [private]

This function is called internally to parse a CfDef object. The data is saved in this QCassandraTabel.

Parameters:
[in]dataThe pointer to the CfDef object.

Definition at line 2040 of file QCassandraTable.cpp.

References columnDefinition(), f_column_definitions, f_from_cassandra, and f_private.

void QtCassandra::QCassandraTable::prepareTableDefinition ( void *  data) const [private]

This function transforms a QCassandra table definition into a Cassandra CfDef structure.

The parameter is passed as a void * because we do not want to define the thrift types in our public headers.

Parameters:
[in]dataThe CfDef were the table is to be saved.

Definition at line 2260 of file QCassandraTable.cpp.

References f_column_definitions, and f_private.

Referenced by QtCassandra::QCassandraPrivate::createTable(), and QtCassandra::QCassandraPrivate::updateTable().

This function returns the read repair chance value.

Returns:
The read repair chance value.

Definition at line 1240 of file QCassandraTable.cpp.

References f_private.

This function reads a set of rows as defined by the row predicate.

To change the consistency for this read, check out the QCassandraColumnPredicate::setConsistencyLevel() function.

If the table is not connected to Cassandra (i.e. the table is a memory table) then nothing happens.

Remember that if you are querying without checking for any column you will get "empty" rows in your results (see dropRow() function for more information and search for TombStones in Cassandra.) This was true in version 0.8.0 to 1.1.5. It may get fixed at some point.

Note that the function updates the predicate so the next call returns the following rows as expected.

Warning:
This function MAY NOT "WORK RIGHT" if your cluster was defined using the RandomPartitioner. Rows are not sorted by key when the RandomPartitioner is used. Instead, the rows are sorted by their MD5 sum. Also the system may add additional data before or after that MD5 and the slice range cannot anyway provide that MD5 to the system. If you want to query sorted slices of your rows, you must create your cluster with another partitioner. Search for partitioner in conf/cassandra.yaml in the Cassandra tarball. See also: http://ria101.wordpress.com/2010/02/22/cassandra-randompartitioner-vs-orderpreservingpartitioner/
Parameters:
[in,out]row_predicateThe row predicate.
Returns:
The number of rows read.
See also:
QCassandraRowPredicate (see detailed description of row predicate for an example)
QCassandraColumnPredicate::setConsistencyLevel()
dropRow()

Definition at line 2472 of file QCassandraTable.cpp.

References f_context, f_from_cassandra, and QtCassandra::QCassandraContext::getRowSlices().

Referenced by exists().

void QtCassandra::QCassandraTable::remove ( const QByteArray &  row_key,
const QByteArray &  column_key,
int64_t  timestamp,
consistency_level_t  consistency_level 
) [private]

This function removes a cell from the Cassandra database as specified by the parameters.

Parameters:
[in]row_keyThe row in which the cell is to be removed.
[in]column_keyThe cell to be removed.
[in]timestampThe time when the key to be removed was created.
[in]consistency_levelThe consistency level to use to remove this cell.

Definition at line 3415 of file QCassandraTable.cpp.

References f_context, f_from_cassandra, QtCassandra::QCassandraContext::remove(), and tableName().

Referenced by QtCassandra::QCassandraRow::dropCell().

This function retrieves the replicate on write flag for this table. If false, the data is only saved on the node you're connected to. If true, it will be duplicated as specified by the replication level.

Returns:
The replicate on write flag status.

Definition at line 1344 of file QCassandraTable.cpp.

References f_private.

QSharedPointer< QCassandraRow > QtCassandra::QCassandraTable::row ( const char *  row_name)

This function searches for a row or, if it doesn't exist, create a new row.

Note that unless you set the value of a column in this row, the row will never appear in the Cassandra cluster.

This function accepts a name for the row. The name is a UTF-8 string. (i.e. if you have an ISO-8859-1 string, make sure to use the QString::fromLatin1() function instead.)

Parameters:
[in]row_nameThe name of the row to search or create.
Returns:
A shared pointer to the matching row or a null pointer.

Definition at line 2499 of file QCassandraTable.cpp.

Referenced by assignRow(), dropRow(), operator[](), and row().

QSharedPointer< QCassandraRow > QtCassandra::QCassandraTable::row ( const wchar_t *  row_name)

This function searches for a row or, if it doesn't exist, create a new row.

Note that unless you set the value of a column in this row, the row will never appear in the Cassandra cluster.

This function accepts a name for the row. The name is viewed as UCS-4 (most Unix) or UCS-2 string (MS-Windows, which means characters with codes between 0xD800 and 0xDFFF are used as is, not converted as in UTF-16.) If you have a UTF-16 string, make sure to use the QString::fromUtf16() function instead.

Parameters:
[in]row_nameThe name of the row to search or create.
Returns:
A shared pointer to the matching row or a null pointer.

Definition at line 2522 of file QCassandraTable.cpp.

References row().

QSharedPointer< QCassandraRow > QtCassandra::QCassandraTable::row ( const QString &  row_name)

This function searches for a row or, if it doesn't exist, create a new row.

Note that unless you set the value of a column in this row, the row will never appear in the Cassandra cluster.

This function accepts a name for the row. The name is a UTF-8 string.

Parameters:
[in]row_nameThe name of the row to search or create.
Returns:
A shared pointer to the matching row or a null pointer.

Definition at line 2541 of file QCassandraTable.cpp.

References row().

QSharedPointer< QCassandraRow > QtCassandra::QCassandraTable::row ( const QUuid &  row_uuid)

This function searches for a row or, if it doesn't exist, create a new row.

Note that unless you set the value of a column in this row, the row will never appear in the Cassandra cluster.

This function assigns the row a UUID key. The key is expected to be valid since it is defined in a QUuid object.

Parameters:
[in]row_uuidThe UUID of the row to search or create.
Returns:
A shared pointer to the matching row or a null pointer.

Definition at line 2561 of file QCassandraTable.cpp.

References row().

QSharedPointer< QCassandraRow > QtCassandra::QCassandraTable::row ( const QByteArray &  row_key)

This function searches for a row or, if it doesn't exist, create a new row.

Note that unless you set the value of a column in this row, the row will never appear in the Cassandra cluster.

This function assigns the row a binary key.

Parameters:
[in]row_keyThe name of the row to search or create.
Returns:
A shared pointer to the matching row or a null pointer.

Definition at line 2580 of file QCassandraTable.cpp.

References f_rows, and QCassandraRow.

This function retrieves the row cache provider class name.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
The row cache provider.

Definition at line 1465 of file QCassandraTable.cpp.

References f_private.

This function retrieves the row cache save period in seconds.

The value may be 0.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
The cache save period in seconds.

Definition at line 949 of file QCassandraTable.cpp.

References f_private.

This function returns the current size of the row cache.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Returns:
The current row cache size.

Definition at line 888 of file QCassandraTable.cpp.

References f_private.

This function returns a constant reference to the map listing all the rows currently defined in memory for this table.

This can be used to determine how many rows are defined in memory and to scan all the data.

Returns:
A constant reference to a map of rows.

Definition at line 2604 of file QCassandraTable.cpp.

References f_rows.

This function defines the probability of the bloom filter.

Bloom filtering is used to save I/O access.

Note that this value is a double.

Since:
Cassandra version 1.0.0
See also:
http://wiki.apache.org/cassandra/ArchitectureOverview#Write_path
Parameters:
[in]chanceThe probability used with the bloom filter.

Definition at line 1155 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setCaching ( const QString &  caching)

This function sets the caching mode of this table definition. The caching is used to know what is kept in memory.

Since:
Cassandra 1.1.0
Parameters:
[in]cachingThe name of the caching mode to use for this table.

Definition at line 788 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setColumnType ( const QString &  column_type)

The default column type is "Standard". It may also be set to "Super".

Exceptions:
std::runtime_errorThis error is generated whenever the column_type parameter is not set to either "Standard" or "Super".
Parameters:
[in]column_typeThe named type of this table definition column.

Definition at line 365 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setComment ( QString  comment)

This function saves a new comment in the table definition.

This is any human readable comment that you want to attach with this table. It is mainly useful for documentation purpose.

Parameters:
[in]commentThe new table comment.

Definition at line 313 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setCompactionStrategy ( const QString &  compaction_strategy)

This function defines the compaction strategy for your data.

Since:
Cassandra version 1.0.0.
Parameters:
[in]compaction_strategyThe name of the compaction strategy.

Definition at line 1823 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setCompactionStrategyOption ( const QString &  option_name,
const QString &  value 
)

This function let you define a strategy option. You specify the name and the value of the option. If the option was already defined, the new value is saved and overwrites the existing value.

Since:
Cassandra version 1.0.0.
Parameters:
[in]option_nameThe name of the compaction strategy option to set.
[in]valueThe new value for this compaction strategy option.

Definition at line 1877 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setComparatorType ( const QString &  comparator_type)

Define the type of comparator to use to compare columns in queries.

The default comparator is "BytesType".

The type must be one of the supported Cassandra types (

See also:
setColumnType()) or the fully qualified name of a class you added.

A common column type is BytesType for binary data. In most cases this will be used as the default.

The internal types available are:

(those marked with an asterisk (*) are defined in the CLI documentation for CREATE COLUMN FAMILY function; if they are not defined there, it is either not available or that documentation was not up to date)

  • AsciiType (*)
  • BooleanType
  • BytesType (*)
  • CounterColumnType (*)
  • DateType
  • DoubleType
  • FloatType
  • IntegerType (*)
  • LexicalUUIDType (*)
  • LongType (*)
  • TimeUUIDType
  • UTF8Type (*)
  • UUIDType

Note that all these types are not available for all the different keys.

The composite types can be defined using the following two names. These are used with a list of parameters which are basic types. This list defines the type of each key defined in columns. Since you define a composite type at the level of a table, all the columns are assigned that exact same composite type. To access the columns, you must use the compositeCell() functions on the QCassandraRow. The default column access will fail unless you know how to create the QArrayByte key.

  • CompositeType
  • DynamicCompositeType

A composite type may define three columns as follow:

 CompositeType(UTF8Type, IntegerType, UUIDType);

Some types that are defined but I have no clue what they mean:

  • LocalByPartitionerType (TBD?)
Note:
This function does not check the validity of the parameter since it has no way of knowing whether the parameter is a valid type.
Parameters:
[in]comparator_typeThe type of the column comparator.

Definition at line 644 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setCompressionOption ( const QString &  option_name,
const QString &  value 
)

This function let you define a compression option. You specify the name and the value of the option. If the option was already defined, the new value is saved and overwrites the existing value.

Since:
Cassandra version 1.0.0.
Parameters:
[in]option_nameThe name of the compression option to set.
[in]valueThe new value for this compression option.

Definition at line 1954 of file QCassandraTable.cpp.

References f_private.

This function can be used to change the DC local read repair chance value.

Since:
Cassandra version 1.1.0.
Parameters:
[in]repair_chanceThe chance to repair local data for a read.

Definition at line 1256 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setDefaultValidationClass ( const QString &  validation_class)

This function defines the default validation class for the table columns. By default it is set to binary (BytesType), which is similar to saying no validation is required.

The CLI documentation says that the following are valid as a default validation class:

AsciiType, BytesType, CounterColumnType, IntegerType, LexicalUUIDType, LongType, UTF8Type

Parameters:
[in]validation_classThe default validation class for columns data.

Definition at line 435 of file QCassandraTable.cpp.

References f_private.

Referenced by setDefaultValidationClassForCounters().

This function is a specialized version of the setDefaultValidationClass() with the name of the class necessary to create a table of counters. Remember that once in this state a table cannot be converted.

This is equivalent to setDefaultValidationClass("CounterColumnType").

Definition at line 416 of file QCassandraTable.cpp.

References setDefaultValidationClass().

This very case happens when the user creates a new context that, at the time of calling QCassandraContext::create(), includes a list of table definitions.

In that case we know that the context is being created, but not the tables because the server does it transparently in one go.

Definition at line 2028 of file QCassandraTable.cpp.

References f_from_cassandra.

Cassandra uses a garbage collection mechanism to manage its data.

The default value for this parameter is 10 days (864000.) This value needs to be large enough for your entire ring of nodes to clear their garbage collection before a new cycle starts (don't ask me! I would think they should have a flag to prevent two such collections... but there are problems difficult to circumvent with potential hardware failures.)

Parameters:
[in]secondsHow often tombstones are searched for.

Definition at line 1485 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setIdentifier ( int32_t  identifier)

This function is provided to let the user choose an identifier for his tables. Identifiers must be unique and in general it is better to let the system define an identifier for you.

Note:
From my understanding the identifier generated by the Cassandra system helps in properly manage the content of the table within your cluster. This is why it is safer not to temper with this information. However, if you enlarge or shrink your cluster, it may be necessary to do so.
Parameters:
[in]identifierThe identifier to use for this table.

Definition at line 260 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setKeyAlias ( const QString &  key_alias)

Each table name can make use of one key alias as defined by this entry.

This is used by CQL at this point so the key can be represented by a name other than KEY. This way it looks a little more like a column name. Note that the alias cannot match the name of any one column.

Parameters:
[in]key_aliasThe new key alias to use with the table definition.

Definition at line 539 of file QCassandraTable.cpp.

References f_private.

This function defines the number of seconds to wait before saving the cached keys on disk. This is useful if you want to restart Cassandra with a non empty cache.

If you rarely restart Cassandra, a larger number is better.

The default is 0.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Parameters:
[in]secondsThe number of seconds the data should be kept in memory.

Definition at line 1031 of file QCassandraTable.cpp.

References f_private.

Set the size of the cache where keys are saved. This cache is used to quickly search the location of rows. This is similar to an in memory index.

The size can either be expressed in a percent (0.01 to 0.99) or as an absolute number of keys (200,000).

Deprecated:
This function is ignored in Cassandra version 1.1+.
Parameters:
[in]sizeThe size of the key cache.

Definition at line 970 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setKeyValidationClass ( const QString &  validation_class)

The table name is called a key. This key can be used in queries and as such may need to be of a very specific type. This function can be used to define that type.

The supported types for a table key are:

AsciiType, BytesType, IntegerType, LexicalUUIDType, LongType, UTF8Type

The default is BytesType, which means not validation is applied to the key.

Parameters:
[in]validation_classThe new key validation class for this table name.

Definition at line 489 of file QCassandraTable.cpp.

References f_private.

This function sets the maximum compaction threshold of a table. When this limit is reached, then files are concatenated to ensure better read access times.

Setting the compaction to zero disables this feature.

Parameters:
[in]thresholdThe maximum threshold before compaction occurs.

Definition at line 1772 of file QCassandraTable.cpp.

References f_private.

This function defines how often tables cached in memory get flushed to disk (i.e. when they are that old, write a copy.)

This flush function forces the flush whether or not the number of operations or size limits were reached.

It should be larger on production systems. Cassandra recommends you to use 1 day (1,440 minutes.) The default is 60 (1h.)

Deprecated:
This function is ignored in Cassandra version 1.1+.
Parameters:
[in]minutesThe number of minutes a table will be kept in the memory cache.

Definition at line 1542 of file QCassandraTable.cpp.

References f_private.

This function defines the number of operations that can be executed against a memory table before it gets flushed.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Parameters:
[in]operationsThe number of operations in millions.

Definition at line 1661 of file QCassandraTable.cpp.

References f_private.

This function sets the memtable throughput in megabytes. This means the tables are flushed after that much data was written to them.

A larger number is better especially if you send many writes to Cassandra in random order (i.e. not sorted.) However, this represents a lot of memory buffers and you want to avoid swapping.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Parameters:
[in]megabytesThe number of megabytes.

Definition at line 1605 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setMergeShardsChance ( double  merge_shards_chance)

Counters may generate a contention. To break that contention, it is possible to break them up into shards (counter sharding). This value defines the chance that the system will reverse the process.

The default is 0.0

Deprecated:
This function is ignored in Cassandra version 1.1+.
Parameters:
[in]merge_shards_chanceThe chance that shards get merged.

Definition at line 1365 of file QCassandraTable.cpp.

References f_private.

This function is used to change the minimum size to reach before compacting data on disk.

Data is saved in separate files. Reading multiple files is slow. The compaction mechanism is used to concatenate multiple files one after another. This makes the read of older data much faster.

Data that constantly changes should have a larger threshold since it otherwise would often break up the compaction anyway.

Setting the compaction to zero disables this feature.

Parameters:
[in]thresholdThe threshold before compressing data.

Definition at line 1723 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setReadRepairChance ( double  repair_chance)

This function can be used to change the read repair chance value.

Parameters:
[in]repair_chanceThe chance to repair data for a read.

Definition at line 1209 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setReplicateOnWrite ( bool  replicate_on_write)

This function defines the replication flag. On write you can ask for counters to be replicated (the default) on other nodes.

Parameters:
[in]replicate_on_writeWhether counters are replicated on different nodes.

Definition at line 1309 of file QCassandraTable.cpp.

References f_private.

This function defines the number of row keys that should be cached.

Since:
Cassandra version 1.0.0
Deprecated:
This function is ignored in Cassandra version 1.1+.
Parameters:
[in]countThe number of seconds the data should be kept in memory.

Definition at line 1089 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setRowCacheProvider ( const QString &  provider)

The class to be used to as the row cache provider.

It defaults to: org.apache.cassandra.cache.ConcurrentLinkedHashCacheProvider.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Parameters:
[in]providerThe row cache provider class name.

Definition at line 1425 of file QCassandraTable.cpp.

References f_private.

It is possible, with Cassandra, to save the cache to disk. This allows you to restart Cassandra with a non-empty cache. Whether this is useful will very much depend on your data.

If you rarely restart Cassandra, then a larger number is better.

Deprecated:
This function is ignored in Cassandra version 1.1+.
Parameters:
[in]secondsThe number of seconds the cache is retained for.

Definition at line 909 of file QCassandraTable.cpp.

References f_private.

This function defines the number of rows from this table that should be cached.

By default this is set to zero as by default no rows are being cached. A very large table may benefit from a cache but really only if you know that the same row(s) will be hit over and over again.

The size can either be expressed in a percent (0.01 to 0.99) or as an absolute number of rows (200000).

Deprecated:
This function is ignored in Cassandra version 1.1+.
Parameters:
[in]sizeThe size required for this table row cache.

Definition at line 851 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::setSubcomparatorType ( const QString &  subcomparator_type)

This function sets the sub-comparator type of this table definition. The sub-comparator is used against super columns data.

You cannot define the sub-comparator type on a Standard table. Only Super tables accepts this parameter.

The default is undefined.

Parameters:
[in]subcomparator_typeThe new sub-comparator type.

Definition at line 696 of file QCassandraTable.cpp.

References f_private.

This function retrieves the sub-comparator type and return its name. If no sub-comparator is defined, an empty string is returned ("").

Returns:
The sub-comparator or an empty string.

Definition at line 729 of file QCassandraTable.cpp.

References f_private.

This function returns the name of this table. Note that the name cannot be changed.

Returns:
The table name.

Definition at line 240 of file QCassandraTable.cpp.

References f_private.

Referenced by addValue(), getCellCount(), QtCassandra::QCassandraPrivate::getColumnSlice(), QtCassandra::QCassandraPrivate::getRowSlices(), getValue(), insertValue(), remove(), and QtCassandra::QCassandraPrivate::truncateTable().

The truncate() function removes all the rows from a Cassandra table and clear out the cached data (rows and cells.)

If the table is not connected to Cassandra, then nothing happens with the Cassandra server.

If you want to keep a copy of the cache, you will have to retrieve a copy of the rows map using the rows() function.

See also:
rows()
clearCache()

Definition at line 2420 of file QCassandraTable.cpp.

References clearCache(), f_context, f_from_cassandra, and QtCassandra::QCassandraContext::truncateTable().

This function is called whenever you drop a table which means that all the data in that table is now not accessible (at least not on Cassandra.)

Any future function call that require the parent will fail with an exception.

Further, this call releases its rows (and consequently cells) also calling unparent() on them.

Definition at line 3436 of file QCassandraTable.cpp.

References clearCache(), and f_context.

This function marks the bloom filter probability parameter as not set.

Since:
Cassandra version 1.0.0.
See also:
http://wiki.apache.org/cassandra/ArchitectureOverview#Write_path

Definition at line 1168 of file QCassandraTable.cpp.

References f_private.

This function marks the caching mode as unset.

Since:
Cassandra 1.1.0

Definition at line 799 of file QCassandraTable.cpp.

References f_private.

This function clears the set of the column type.

Definition at line 378 of file QCassandraTable.cpp.

References f_private.

This function marks the comment as not set.

Definition at line 322 of file QCassandraTable.cpp.

References f_private.

This function marks the compaction strategy as unset.

Since:
Cassandra version 1.0.0.

Definition at line 1834 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::unsetCompactionStrategyOption ( const QString &  option_name)

This function removes the specified option from the array of options. When the array is used, if no options are defined, then the compaction strategy options is marked as not set at all.

Since:
Cassandra version 1.0.0.
Parameters:
[in]option_nameThe name of the compaction strategy option to unset.

Definition at line 1893 of file QCassandraTable.cpp.

References f_private.

This function resets the comparator flag to false so it looks like the comparator wasn't set. The default or current value will be used instead.

Definition at line 654 of file QCassandraTable.cpp.

References f_private.

void QtCassandra::QCassandraTable::unsetCompressionOption ( const QString &  option_name)

This function removes the specified option from the array of options. When the array is used, if no options are defined, then the compression options is marked as not set at all.

Since:
Cassandra version 1.0.0.
Parameters:
[in]option_nameThe name of the compression option to unset.

Definition at line 1970 of file QCassandraTable.cpp.

References f_private.

This function marks the read repair chance as unset.

Since:
Cassandra version 1.1.0.

Definition at line 1267 of file QCassandraTable.cpp.

References f_private.

This function removes the effects of setDefaultValidationClass() calls.

Definition at line 444 of file QCassandraTable.cpp.

References f_private.

This function marks the Garbage Collection Grace period as unset.

Definition at line 1495 of file QCassandraTable.cpp.

References f_private.

This function marks the table identifier as unset. This is the default when creating a new table as you expect the Cassandra system to generate the necessary identifier.

Definition at line 271 of file QCassandraTable.cpp.

References f_private.

Cancel the effect of a previous setKeyAlias() call.

Definition at line 548 of file QCassandraTable.cpp.

References f_private.

This function marks the key cache save period in seconds parameter as not set.

Deprecated:
This function is ignored in Cassandra version 1.1+.

Definition at line 1044 of file QCassandraTable.cpp.

References f_private.

This function removes the effect of previous calls to the setKeyCacheSize() function.

Deprecated:
This function is ignored in Cassandra version 1.1+.

Definition at line 983 of file QCassandraTable.cpp.

References f_private.

This function marks the key validation class parameter as unset so it doesn't get sent to the Cassandra serer.

Definition at line 499 of file QCassandraTable.cpp.

References f_private.

This function marks the maximum compaction parameter as unset.

Definition at line 1782 of file QCassandraTable.cpp.

References f_private.

This function cancels the effects of the setMemtableFlushAfterMins() call.

Deprecated:
This function is ignored in Cassandra version 1.1+.
See also:
setMemtableFlushAfterMins()

Definition at line 1556 of file QCassandraTable.cpp.

References f_private.

This function marks the memory table operations in millions as unset.

Deprecated:
This function is ignored in Cassandra version 1.1+.

Definition at line 1673 of file QCassandraTable.cpp.

References f_private.

This function marks the table definition as not having a memtable throughput value.

Deprecated:
This function is ignored in Cassandra version 1.1+.

Definition at line 1618 of file QCassandraTable.cpp.

References f_private.

Mark the merge shards chance value as unset.

Deprecated:
This function is ignored in Cassandra version 1.1+.

Definition at line 1377 of file QCassandraTable.cpp.

References f_private.

This function cancels calls to the setMinCompactionThreshold() function.

Definition at line 1732 of file QCassandraTable.cpp.

References f_private.

This function marks the read repair chance as unset.

Definition at line 1218 of file QCassandraTable.cpp.

References f_private.

This function cancels the setReplicateOnWrite() function call by marking the flag as unset.

Definition at line 1319 of file QCassandraTable.cpp.

References f_private.

This function marks the row cache keys to save parameter as not set.

Since:
Cassandra version 1.0.0.
Deprecated:
This function is ignored in Cassandra version 1.1+.

Definition at line 1103 of file QCassandraTable.cpp.

References f_private.

This function cancels the call to the setRowCacheProvider() function.

Deprecated:
This function is ignored in Cassandra version 1.1+.

Definition at line 1437 of file QCassandraTable.cpp.

References f_private.

This function marks the row cache save period in seconds as not set at all.

Deprecated:
This function is ignored in Cassandra version 1.1+.

Definition at line 922 of file QCassandraTable.cpp.

References f_private.

This function marks the row cache size as unset.

Deprecated:
This function is ignored in Cassandra version 1.1+.

Definition at line 863 of file QCassandraTable.cpp.

References f_private.

This function marks the sub-comparator type as unset.

Definition at line 705 of file QCassandraTable.cpp.

References f_private.

This function is used to update a table with changes that you made in memory (i.e. calling functions such as setDefaultValidationClass().)

Note that you must synchronize your Cassandra schema in your entire cluster with a call to the QCassandra::synchornizeSchemaVersions() function before you use an updated table.

This function is most often used to define new column types or changing existing columns (although changing existing columns may not work as expected, from what I understand, TBD. I suggest you create new columns and copy the data if you run into problems.)

See also:
setDefaultValidationClass()
QCassandra::synchronizeSchemaVersions()

Definition at line 2369 of file QCassandraTable.cpp.

References f_context, f_from_cassandra, and QtCassandra::QCassandraContext::updateTable().


Friends And Related Function Documentation

friend class QCassandraContext [friend]

Definition at line 258 of file QCassandraTable.h.

friend class QCassandraPrivate [friend]

Definition at line 257 of file QCassandraTable.h.

friend class QCassandraRow [friend]

Definition at line 260 of file QCassandraTable.h.

Referenced by row().

friend class QCassandraTablePrivate [friend]

Definition at line 259 of file QCassandraTable.h.


Member Data Documentation

Column definitions are used to define a type for the data saved in that row. These definitions are not currently used by the libQtCassandra itself. It is used by the Cassandra server however.

Column definitions are generally required on columns you want to use to index your data.

Definition at line 268 of file QCassandraTable.h.

Referenced by columnDefinition(), columnDefinitions(), parseTableDefinition(), and prepareTableDefinition().

A table is always part of a specific context. You can only create a new table using a function from your context objects.

This is a bare pointer since you cannot delete the context and hope the table remains (i.e. when the context goes, the table goes!) However, you may keep a shared pointer to a table after the table was deleted. In that case, the f_context pointer is set to NULL and calling functions on that table may result in an exception being raised.

Definition at line 267 of file QCassandraTable.h.

Referenced by addValue(), create(), getCellCount(), getColumnSlice(), getValue(), insertValue(), readRows(), remove(), truncate(), unparent(), and update().

A table read from the Cassandra server or created with the create() function is marked as being from Cassandra. All other tables are considered memory tables.

A memory table can be used as a set of global variables with a format similar to a Cassandra table.

If you define a new table with the intend to call the create() function, avoid saving data in the new table as it won't make it to the database. (This may change in the future though.)

Definition at line 262 of file QCassandraTable.h.

Referenced by addValue(), create(), getCellCount(), getColumnSlice(), getValue(), insertValue(), parseTableDefinition(), readRows(), remove(), setFromCassandra(), truncate(), and update().

A table is always part of a specific context. You can only create a new table using a function from your context objects.

This is a bare pointer since you cannot delete the context and hope the table remains (i.e. when the context goes, the table goes!)

Definition at line 263 of file QCassandraTable.h.

Referenced by addValue(), bloomFilterFPChance(), caching(), columnType(), comment(), compactionStrategy(), compactionStrategyOption(), comparatorType(), compressionOption(), contextName(), dcLocalReadRepairChance(), defaultValidationClass(), gcGraceSeconds(), getValue(), hasBloomFilterFPChance(), hasCaching(), hasColumnType(), hasComment(), hasCompactionStrategy(), hasCompactionStrategyOption(), hasCompactionStrategyOptions(), hasComparatorType(), hasCompressionOption(), hasCompressionOptions(), hasDCLocalReadRepairChance(), hasDefaultValidationClass(), hasGcGraceSeconds(), hasIdentifier(), hasKeyAlias(), hasKeyCacheSavePeriodInSeconds(), hasKeyCacheSize(), hasKeyValidationClass(), hasMaxCompactionThreshold(), hasMemtableFlushAfterMins(), hasMemtableOperationsInMillions(), hasMemtableThroughputInMb(), hasMergeShardsChance(), hasMinCompactionThreshold(), hasReadRepairChance(), hasReplicateOnWrite(), hasRowCacheKeysToSave(), hasRowCacheProvider(), hasRowCacheSavePeriodInSeconds(), hasRowCacheSize(), hasSubcomparatorType(), identifier(), insertValue(), keyAlias(), keyCacheSavePeriodInSeconds(), keyCacheSize(), keyRowCacheKeysToSave(), keyValidationClass(), maxCompactionThreshold(), memtableFlushAfterMins(), memtableOperationsInMillions(), memtableThroughputInMb(), mergeShardsChance(), minCompactionThreshold(), parseTableDefinition(), prepareTableDefinition(), QCassandraTable(), readRepairChance(), replicateOnWrite(), rowCacheProvider(), rowCacheSavePeriodInSeconds(), rowCacheSize(), setBloomFilterFPChance(), setCaching(), setColumnType(), setComment(), setCompactionStrategy(), setCompactionStrategyOption(), setComparatorType(), setCompressionOption(), setDCLocalReadRepairChance(), setDefaultValidationClass(), setGcGraceSeconds(), setIdentifier(), setKeyAlias(), setKeyCacheSavePeriodInSeconds(), setKeyCacheSize(), setKeyValidationClass(), setMaxCompactionThreshold(), setMemtableFlushAfterMins(), setMemtableOperationsInMillions(), setMemtableThroughputInMb(), setMergeShardsChance(), setMinCompactionThreshold(), setReadRepairChance(), setReplicateOnWrite(), setRowCacheKeysToSave(), setRowCacheProvider(), setRowCacheSavePeriodInSeconds(), setRowCacheSize(), setSubcomparatorType(), subcomparatorType(), tableName(), unsetBloomFilterFPChance(), unsetCaching(), unsetColumnType(), unsetComment(), unsetCompactionStrategy(), unsetCompactionStrategyOption(), unsetComparatorType(), unsetCompressionOption(), unsetDCLocalReadRepairChance(), unsetDefaultValidationClass(), unsetGcGraceSeconds(), unsetIdentifier(), unsetKeyAlias(), unsetKeyCacheSavePeriodInSeconds(), unsetKeyCacheSize(), unsetKeyValidationClass(), unsetMaxCompactionThreshold(), unsetMemtableFlushAfterMins(), unsetMemtableOperationsInMillions(), unsetMemtableThroughputInMb(), unsetMergeShardsChance(), unsetMinCompactionThreshold(), unsetReadRepairChance(), unsetReplicateOnWrite(), unsetRowCacheKeysToSave(), unsetRowCacheProvider(), unsetRowCacheSavePeriodInSeconds(), unsetRowCacheSize(), and unsetSubcomparatorType().

The system caches rows in this map. The map index is the row key. You can clear the table using the clearCache() function.

Definition at line 269 of file QCassandraTable.h.

Referenced by clearCache(), dropRow(), exists(), findRow(), getCellCount(), row(), and rows().


The documentation for this class was generated from the following files:

This document is part of the Snap! Websites Project.

Copyright © 2011-2013 by Made to Order Software Corp.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly