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

#include <client.h>

Public Member Functions

int NumPartitions () const
 
Status PartitionRow (const KuduPartialRow &row, int *partition)
 

Detailed Description

A KuduPartitioner allows clients to determine the target partition of a row without actually performing a write. The set of partitions is eagerly fetched when the KuduPartitioner is constructed so that the actual partitioning step can be performed synchronously without any network trips.

Note
Because this operates on a metadata snapshot retrieved at construction time, it will not reflect any metadata changes to the table that have occurred since its creation.
Warning
This class is not thread-safe.

Member Function Documentation

int kudu::client::KuduPartitioner::NumPartitions ( ) const
Returns
the number of partitions known by this partitioner. The partition indices returned by PartitionRow are guaranteed to be less than this value.
Status kudu::client::KuduPartitioner::PartitionRow ( const KuduPartialRow row,
int *  partition 
)

Determine the partition index that the given row falls into.

Parameters
[in]rowThe row to be partitioned.
[out]partitionThe resulting partition index, or -1 if the row falls into a non-covered range. The result will be less than NumPartitions().
Returns
Status::OK if successful. May return a bad Status if the provided row does not have all columns of the partition key set.

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