Kudu C++ client API
Public Member Functions | Static Public Member Functions | List of all members
kudu::client::KuduScanToken Class Reference

A scan descriptor limited to a single physical contiguous location. More...

#include <client.h>

Public Member Functions

Status IntoKuduScanner (KuduScanner **scanner) const WARN_UNUSED_RESULT
 
const KuduTablettablet () const
 
Status Serialize (std::string *buf) const WARN_UNUSED_RESULT
 

Static Public Member Functions

static Status DeserializeIntoScanner (KuduClient *client, const std::string &serialized_token, KuduScanner **scanner) WARN_UNUSED_RESULT
 

Detailed Description

A scan descriptor limited to a single physical contiguous location.

A KuduScanToken describes a partial scan of a Kudu table limited to a single contiguous physical location. Using the KuduScanTokenBuilder, clients can describe the desired scan, including predicates, bounds, timestamps, and caching, and receive back a collection of scan tokens.

Each scan token may be separately turned into a scanner using KuduScanToken::IntoKuduScanner, with each scanner responsible for a disjoint section of the table.

Scan tokens may be serialized using the KuduScanToken::Serialize method and deserialized back into a scanner using the KuduScanToken::DeserializeIntoScanner method. This allows use cases such as generating scan tokens in the planner component of a query engine, then sending the tokens to execution nodes based on locality, and then instantiating the scanners on those nodes.

Scan token locality information can be inspected using the KuduScanToken::tablet() function.

Member Function Documentation

◆ DeserializeIntoScanner()

static Status kudu::client::KuduScanToken::DeserializeIntoScanner ( KuduClient client,
const std::string &  serialized_token,
KuduScanner **  scanner 
)
static

Create a new scanner and set the scanner options.

Parameters
[in]clientClient to bound to the scanner.
[in]serialized_tokenToken containing serialized scanner parameters.
[out]scannerThe result scanner. The caller owns the new scanner. The scanner must be opened before use. The scanner will not be set if the returned status is an error.
Returns
Operation result status.

◆ IntoKuduScanner()

Status kudu::client::KuduScanToken::IntoKuduScanner ( KuduScanner **  scanner) const

Create a new scanner.

This method creates a new scanner, setting the result scanner's options according to the scan token.

Parameters
[out]scannerThe result scanner. The caller owns the new scanner. The scanner must be opened before use. The output parameter will not be set if the returned status is an error.
Returns
Operation result status.

◆ Serialize()

Status kudu::client::KuduScanToken::Serialize ( std::string *  buf) const

Serialize the token into a string.

The resulting string can be deserialized with KuduScanToken::Deserialize() to

Parameters
[out]bufResult string to output the serialized token.
Returns
Operation result status.

◆ tablet()

const KuduTablet& kudu::client::KuduScanToken::tablet ( ) const
Returns
Tablet that this scan will retrieve rows from.

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