Kudu C++ client API
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Friends | 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
 
int num_replicas () const
 
KuduInsertNewInsert ()
 
KuduUpsertNewUpsert ()
 
KuduUpdateNewUpdate ()
 
KuduDeleteNewDelete ()
 
KuduPredicateNewComparisonPredicate (const Slice &col_name, KuduPredicate::ComparisonOp op, KuduValue *value)
 
KuduClientclient () const
 
const PartitionSchema & partition_schema () const
 

Friends

class KuduClient
 

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

KuduClient* kudu::client::KuduTable::client ( ) const
Returns
The KuduClient object associated with the table. The caller should not free the returned pointer.
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.
const std::string& kudu::client::KuduTable::name ( ) const
Returns
Name of the table.
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.
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().
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().
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().
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().
int kudu::client::KuduTable::num_replicas ( ) const
Returns
Replication factor of the table.
const PartitionSchema& kudu::client::KuduTable::partition_schema ( ) const
Returns
The partition schema for the table.
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: