Kudu C++ client API
Loading...
Searching...
No Matches
KuduScanBatch Class Reference

A batch of zero or more rows returned by a scan operation. More...

#include <scan_batch.h>

Classes

class  const_iterator
 Iterator to work with immutable KuduScanBatch instances. More...
class  RowPtr
 A handle for a single row in KuduScanBatch. More...

Public Types

typedef RowPtr value_type
 A handy typedef for the RowPtr.

Public Member Functions

int NumRows () const
KuduScanBatch::RowPtr Row (int idx) const
const_iterator begin () const
const_iterator end () const
const KuduSchemaprojection_schema () const
Advanced/Unstable API

There are no guarantees on the stability of the format returned by these methods, which might change at any given time.

Note
The Slices returned by both direct_data() and indirect_data() are only valid for the lifetime of the KuduScanBatch.
Slice direct_data () const
Slice indirect_data () const

Detailed Description

A batch of zero or more rows returned by a scan operation.

Every call to KuduScanner::NextBatch() returns a batch of zero or more rows. You can iterate over the rows in the batch using:

range-foreach loop (C++11):

for (KuduScanBatch::RowPtr row : batch) {
... row.GetInt(1, ...)
...
}
A handle for a single row in KuduScanBatch.
Definition scan_batch.h:164

regular for loop (C++03):

for (KuduScanBatch::const_iterator it = batch.begin(), it != batch.end();
++it) {
...
}
Iterator to work with immutable KuduScanBatch instances.
Definition scan_batch.h:381

or

for (int i = 0, num_rows = batch.NumRows();
i < num_rows;
i++) {
KuduScanBatch::RowPtr row = batch.Row(i);
...
}
Note
In the above example, NumRows() is only called once at the beginning of the loop to avoid extra calls to the non-inlined method.

Member Function Documentation

◆ begin()

KuduScanBatch::const_iterator kudu::client::KuduScanBatch::begin ( ) const
inline
Returns
Forward iterator to the start of the rows in the batch.

◆ direct_data()

Slice kudu::client::KuduScanBatch::direct_data ( ) const

Return a slice that points to the direct row data received from the server. Users of this API must have knowledge of the data format in order to decode the data.

Warning
Unstable API
Returns
a Slice that points to the raw direct row data.

◆ end()

KuduScanBatch::const_iterator kudu::client::KuduScanBatch::end ( ) const
inline
Returns
Forward iterator to the end of the rows in the batch.

◆ indirect_data()

Slice kudu::client::KuduScanBatch::indirect_data ( ) const

Like the method above, but for indirect data.

Warning
Unstable API
Returns
a Slice that points to the raw indirect row data.

◆ NumRows()

int kudu::client::KuduScanBatch::NumRows ( ) const
Returns
The number of rows in this batch.

◆ projection_schema()

const KuduSchema * kudu::client::KuduScanBatch::projection_schema ( ) const
Returns
The projection schema for this batch. All KuduScanBatch::RowPtr returned by this batch are guaranteed to have this schema.

◆ Row()

KuduScanBatch::RowPtr kudu::client::KuduScanBatch::Row ( int idx) const

Get a row at the specified index.

Parameters
[in]idxThe index of the row to return.
Returns
A reference to one of the rows in this batch. The returned object is only valid for as long as this KuduScanBatch object is valid.

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