Kudu C++ client API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
kudu::client::KuduTable Class Reference

A representation of a table on a particular cluster. More...

#include <client.h>

Inheritance diagram for kudu::client::KuduTable:

Public Member Functions

const std::string & name () const
 
const std::string & id () const
 
const KuduSchemaschema () const
 
const std::string & comment () const
 
int num_replicas () const
 
const std::string & owner () const
 
KuduInsertNewInsert ()
 
KuduInsertIgnoreNewInsertIgnore ()
 
KuduUpsertNewUpsert ()
 
KuduUpsertIgnoreNewUpsertIgnore ()
 
KuduUpdateNewUpdate ()
 
KuduUpdateIgnoreNewUpdateIgnore ()
 
KuduDeleteNewDelete ()
 
KuduDeleteIgnoreNewDeleteIgnore ()
 
KuduPredicateNewComparisonPredicate (const Slice &col_name, KuduPredicate::ComparisonOp op, KuduValue *value)
 
KuduPredicateNewInBloomFilterPredicate (const Slice &col_name, std::vector< KuduBloomFilter * > *bloom_filters)
 
KuduPredicateNewInListPredicate (const Slice &col_name, std::vector< KuduValue * > *values)
 
KuduPredicateNewIsNotNullPredicate (const Slice &col_name)
 
KuduPredicateNewIsNullPredicate (const Slice &col_name)
 
KuduClientclient () 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.

KuduPredicateNewInBloomFilterPredicate (const Slice &col_name, const std::vector< Slice > &bloom_filters)
 

Detailed Description

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:

Note
This class is thread-safe.

Member Function Documentation

◆ client()

KuduClient * kudu::client::KuduTable::client ( ) const
Returns
The KuduClient object associated with the table. The caller should not free the returned pointer.

◆ comment()

const std::string & kudu::client::KuduTable::comment ( ) const
Returns
Comment string for the table.

◆ extra_configs()

const std::map< std::string, std::string > & kudu::client::KuduTable::extra_configs ( ) const
Returns
The table's extra configuration properties.

◆ id()

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.

Returns
Identifier string for the table.

◆ name()

const std::string & kudu::client::KuduTable::name ( ) const
Returns
Name of the table.

◆ NewComparisonPredicate()

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.

Parameters
[in]col_nameName of column to use for comparison.
[in]opComparison operator to use.
[in]valueThe 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.
Returns
Raw pointer to instance of comparison predicate. The caller owns the result until it is passed into KuduScanner::AddConjunctPredicate(). The returned predicate object takes ownership over the 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.

◆ NewDelete()

KuduDelete * kudu::client::KuduTable::NewDelete ( )
Returns
New DELETE operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply().

◆ NewDeleteIgnore()

KuduDeleteIgnore * kudu::client::KuduTable::NewDeleteIgnore ( )
Returns
New DELETE_IGNORE operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply().

◆ NewInBloomFilterPredicate() [1/2]

KuduPredicate * kudu::client::KuduTable::NewInBloomFilterPredicate ( const Slice col_name,
const std::vector< Slice > &  bloom_filters 
)

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.

IN Bloom filter predicate may be automatically disabled if determined to be ineffective in filtering rows during scan requests.

Users are expected to perform further filtering to guard against false positives and automatic disablement of an ineffective Bloom filter predicate to get precise set membership information.

Warning
This method is experimental and may change or disappear in future.
Parameters
[in]col_nameName of the column to which the predicate applies.
bloom_filtersVector of BlockBloomFilter pointers 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 NOT take ownership of the pointers contained in bloom_filters and caller is responsible for the lifecycle management of the Bloom filters. The supplied Bloom filters are expected to remain valid for the lifetime of the KuduScanner.
Returns
Raw pointer to an IN Bloom filter predicate. The caller owns the predicate until it is passed into KuduScanner::AddConjunctPredicate(). In the case of an error (e.g. an invalid column name), a non-NULL value is still returned. The error will be returned when attempting to add this predicate to a KuduScanner.

◆ NewInBloomFilterPredicate() [2/2]

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 Bloom filter predicate may be automatically disabled if determined to be ineffective in filtering rows during scan requests.

Users are expected to perform further filtering to guard against false positives and automatic disablement of an ineffective Bloom filter predicate to get precise set membership information.

Parameters
[in]col_nameName of the column to which the predicate applies.
[in]bloom_filtersVector 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.
Returns
Raw pointer to an IN Bloom filter predicate. The caller owns the predicate until it is passed into KuduScanner::AddConjunctPredicate(). In the case of an error (e.g. an invalid column name), a non-NULL value is still returned. The error will be returned when attempting to add this predicate to a KuduScanner.

◆ NewInListPredicate()

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.

Parameters
[in]col_nameName of the column to which the predicate applies.
[in]valuesVector of values which the column will be matched against.
Returns
Raw pointer to an IN list predicate. The caller owns the predicate until it is passed into KuduScanner::AddConjunctPredicate(). The returned predicate takes ownership of the values vector and its elements. In the case of an error (e.g. an invalid column name), a non-NULL value is still returned. The error will be returned when attempting to add this predicate to a KuduScanner.

◆ NewInsert()

KuduInsert * kudu::client::KuduTable::NewInsert ( )
Returns
New INSERT operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply().

◆ NewInsertIgnore()

KuduInsertIgnore * kudu::client::KuduTable::NewInsertIgnore ( )
Returns
New INSERT_IGNORE operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply().

◆ NewIsNotNullPredicate()

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.

Parameters
[in]col_nameName of the column to which the predicate applies
Returns
Raw pointer to an IS NOT NULL predicate. The caller owns the predicate until it is passed into KuduScanner::AddConjunctPredicate(). In the case of an error (e.g. an invalid column name), a non-NULL value is still returned. The error will be returned when attempting to add this predicate to a KuduScanner.

◆ NewIsNullPredicate()

KuduPredicate * kudu::client::KuduTable::NewIsNullPredicate ( const Slice col_name)

Create a new IS NULL predicate which can be used for scanners on this table.

Parameters
[in]col_nameName of the column to which the predicate applies
Returns
Raw pointer to an IS NULL predicate. The caller owns the predicate until it is passed into KuduScanner::AddConjunctPredicate(). In the case of an error (e.g. an invalid column name), a non-NULL value is still returned. The error will be returned when attempting to add this predicate to a KuduScanner.

◆ NewUpdate()

KuduUpdate * kudu::client::KuduTable::NewUpdate ( )
Returns
New UPDATE operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply().

◆ NewUpdateIgnore()

KuduUpdateIgnore * kudu::client::KuduTable::NewUpdateIgnore ( )
Returns
New UPDATE_IGNORE operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply().

◆ NewUpsert()

KuduUpsert * kudu::client::KuduTable::NewUpsert ( )
Returns
New UPSERT operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply().

◆ NewUpsertIgnore()

KuduUpsertIgnore * kudu::client::KuduTable::NewUpsertIgnore ( )
Returns
New UPSERT_IGNORE operation for this table. It is the caller's responsibility to free the result, unless it is passed to KuduSession::Apply().

◆ num_replicas()

int kudu::client::KuduTable::num_replicas ( ) const
Returns
Replication factor of the table.

◆ owner()

const std::string & kudu::client::KuduTable::owner ( ) const
Returns
Owner of the table (empty string if unset).

◆ partition_schema()

const PartitionSchema & kudu::client::KuduTable::partition_schema ( ) const
Returns
The partition schema for the table.

◆ schema()

const KuduSchema & kudu::client::KuduTable::schema ( ) const
Returns
Reference to the table's schema object.

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