Kudu C++ client API
|
A representation of a table on a particular cluster. More...
#include <client.h>
Public Member Functions | ||||||||||
const std::string & | name () const | |||||||||
const std::string & | id () const | |||||||||
const KuduSchema & | schema () const | |||||||||
int | num_replicas () const | |||||||||
KuduInsert * | NewInsert () | |||||||||
KuduInsertIgnore * | NewInsertIgnore () | |||||||||
KuduUpsert * | NewUpsert () | |||||||||
KuduUpdate * | NewUpdate () | |||||||||
KuduDelete * | NewDelete () | |||||||||
KuduPredicate * | NewComparisonPredicate (const Slice &col_name, KuduPredicate::ComparisonOp op, KuduValue *value) | |||||||||
KuduPredicate * | NewInBloomFilterPredicate (const Slice &col_name, std::vector< KuduBloomFilter * > *bloom_filters) | |||||||||
KuduPredicate * | NewInListPredicate (const Slice &col_name, std::vector< KuduValue * > *values) | |||||||||
KuduPredicate * | NewIsNotNullPredicate (const Slice &col_name) | |||||||||
KuduPredicate * | NewIsNullPredicate (const Slice &col_name) | |||||||||
KuduClient * | client () const | |||||||||
const PartitionSchema & | partition_schema () const | |||||||||
const std::map< std::string, std::string > & | extra_configs () const | |||||||||
Advanced/Unstable API | ||||||||||
There are no guarantees on the stability of this client API. Create a new IN Bloom filter predicate using direct BlockBloomFilter pointers which can be used for scanners on this table. A Bloom filter is a space-efficient probabilistic data structure used to test set membership with a possibility of false positive matches. IN list predicate can be used with small number of values; on the other hand with IN Bloom filter predicate large number of values can be tested for membership in a space-efficient manner.
| ||||||||||
KuduPredicate * | NewInBloomFilterPredicate (const Slice &col_name, const Slice &allocator, const std::vector< Slice > &bloom_filters) | |||||||||
A representation of a table on a particular cluster.
A KuduTable holds the current schema of the table. Any given KuduTable object belongs to a specific KuduClient object.
Upon construction, the table is looked up in the catalog (or catalog cache), and the schema fetched for introspection.
This class is also a factory for write operation on the table. The provided operations are:
KuduClient* kudu::client::KuduTable::client | ( | ) | const |
const std::map<std::string, std::string>& kudu::client::KuduTable::extra_configs | ( | ) | const |
const std::string& kudu::client::KuduTable::id | ( | ) | const |
Get the table's ID.
This is an internal identifier which uniquely identifies a table. If the table is deleted and recreated with the same name, the ID will distinguish the old table from the new.
const std::string& kudu::client::KuduTable::name | ( | ) | const |
KuduPredicate* kudu::client::KuduTable::NewComparisonPredicate | ( | const Slice & | col_name, |
KuduPredicate::ComparisonOp | op, | ||
KuduValue * | value | ||
) |
Create a new comparison predicate.
This method creates new instance of a comparison predicate which can be used for scanners on this table object.
[in] | col_name | Name of column to use for comparison. |
[in] | op | Comparison operator to use. |
[in] | value | The type of the value must correspond to the type of the column to which the predicate is to be applied. For example, if the given column is any type of integer, the KuduValue should also be an integer, with its value in the valid range for the column type. No attempt is made to cast between floating point and integer values, or numeric and string values. |
value
Non-NULL is returned both in success and error cases. In the case of an error (e.g. invalid column name), a non-NULL value is still returned. The error will be returned when attempting to add this predicate to a KuduScanner. KuduDelete* kudu::client::KuduTable::NewDelete | ( | ) |
DELETE
operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply(). KuduPredicate* kudu::client::KuduTable::NewInBloomFilterPredicate | ( | const Slice & | col_name, |
std::vector< KuduBloomFilter * > * | bloom_filters | ||
) |
Create a new IN Bloom filter predicate which can be used for scanners on this table.
A Bloom filter is a space-efficient probabilistic data structure used to test set membership with a possibility of false positive matches. See KuduBloomFilter
for creating Bloom filters.
IN list predicate can be used with small number of values; on the other hand with IN Bloom filter predicate large number of values can be tested for membership in a space-efficient manner.
[in] | col_name | Name of the column to which the predicate applies. |
[in] | bloom_filters | Vector of Bloom filters that contain the values inserted to match against the column. The column value must match against all the supplied Bloom filters to be returned by the scanner. On return, regardless of success or error, the returned predicate will take ownership of the pointers contained in bloom_filters . |
KuduPredicate* kudu::client::KuduTable::NewInListPredicate | ( | const Slice & | col_name, |
std::vector< KuduValue * > * | values | ||
) |
Create a new IN list predicate which can be used for scanners on this table.
The IN list predicate is used to specify a list of values that a column must match. A row is filtered from the scan if the value of the column does not equal any value from the list.
The type of entries in the list must correspond to the type of the column to which the predicate is to be applied. For example, if the given column is any type of integer, the KuduValues should also be integers, with the values in the valid range for the column type. No attempt is made to cast between floating point and integer values, or numeric and string values.
[in] | col_name | Name of the column to which the predicate applies. |
[in] | values | Vector of values which the column will be matched against. |
KuduInsert* kudu::client::KuduTable::NewInsert | ( | ) |
INSERT
operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply(). KuduInsertIgnore* kudu::client::KuduTable::NewInsertIgnore | ( | ) |
INSERT_IGNORE
operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply(). KuduPredicate* kudu::client::KuduTable::NewIsNotNullPredicate | ( | const Slice & | col_name | ) |
Create a new IS NOT NULL predicate which can be used for scanners on this table.
[in] | col_name | Name of the column to which the predicate applies |
KuduPredicate* kudu::client::KuduTable::NewIsNullPredicate | ( | const Slice & | col_name | ) |
Create a new IS NULL predicate which can be used for scanners on this table.
[in] | col_name | Name of the column to which the predicate applies |
KuduUpdate* kudu::client::KuduTable::NewUpdate | ( | ) |
UPDATE
operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply(). KuduUpsert* kudu::client::KuduTable::NewUpsert | ( | ) |
UPSERT
operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply(). int kudu::client::KuduTable::num_replicas | ( | ) | const |
const PartitionSchema& kudu::client::KuduTable::partition_schema | ( | ) | const |
const KuduSchema& kudu::client::KuduTable::schema | ( | ) | const |