A batch of zero or more rows returned by a scan operation. More...
#include <scan_batch.h>
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 KuduSchema * | projection_schema () const | ||||||
RowPtr () | |||||||
bool | IsNull (const Slice &col_name) const | ||||||
bool | IsNull (int col_idx) const | ||||||
const void * | cell (int col_idx) const | ||||||
std::string | ToString () const | ||||||
KuduScanBatch::RowPtr | operator* () const | ||||||
const_iterator & | operator++ () | ||||||
const_iterator | operator++ (int) | ||||||
bool | operator== (const const_iterator &other) const | ||||||
bool | operator!= (const const_iterator &other) const | ||||||
Getters for integral type columns by column name. | |||||||
| |||||||
Status | GetBool (const Slice &col_name, bool *val) const WARN_UNUSED_RESULT | ||||||
Status | GetInt8 (const Slice &col_name, int8_t *val) const WARN_UNUSED_RESULT | ||||||
Status | GetInt16 (const Slice &col_name, int16_t *val) const WARN_UNUSED_RESULT | ||||||
Status | GetInt32 (const Slice &col_name, int32_t *val) const WARN_UNUSED_RESULT | ||||||
Status | GetInt64 (const Slice &col_name, int64_t *val) const WARN_UNUSED_RESULT | ||||||
Status | GetUnixTimeMicros (const Slice &col_name, int64_t *micros_since_utc_epoch) const WARN_UNUSED_RESULT | ||||||
Status | GetFloat (const Slice &col_name, float *val) const WARN_UNUSED_RESULT | ||||||
Status | GetDouble (const Slice &col_name, double *val) const WARN_UNUSED_RESULT | ||||||
Getters for integral type columns by column index. | |||||||
These methods are faster than their name-based counterparts since using indices avoids a hashmap lookup, so index-based getters should be preferred in performance-sensitive code.
| |||||||
Status | GetBool (int col_idx, bool *val) const WARN_UNUSED_RESULT | ||||||
Status | GetInt8 (int col_idx, int8_t *val) const WARN_UNUSED_RESULT | ||||||
Status | GetInt16 (int col_idx, int16_t *val) const WARN_UNUSED_RESULT | ||||||
Status | GetInt32 (int col_idx, int32_t *val) const WARN_UNUSED_RESULT | ||||||
Status | GetInt64 (int col_idx, int64_t *val) const WARN_UNUSED_RESULT | ||||||
Status | GetUnixTimeMicros (int col_idx, int64_t *micros_since_utc_epoch) const WARN_UNUSED_RESULT | ||||||
Status | GetFloat (int col_idx, float *val) const WARN_UNUSED_RESULT | ||||||
Status | GetDouble (int col_idx, double *val) const WARN_UNUSED_RESULT | ||||||
Getters for string/binary column by column name. | |||||||
Get the string/binary value for a column by its name.
| |||||||
Status | GetString (const Slice &col_name, Slice *val) const WARN_UNUSED_RESULT | ||||||
Status | GetBinary (const Slice &col_name, Slice *val) const WARN_UNUSED_RESULT | ||||||
Getters for string/binary column by column index. | |||||||
Get the string/binary value for a column by its index. These methods are faster than their name-based counterparts since using indices avoids a hashmap lookup, so index-based getters should be preferred in performance-sensitive code.
| |||||||
Status | GetString (int col_idx, Slice *val) const WARN_UNUSED_RESULT | ||||||
Status | GetBinary (int col_idx, Slice *val) const WARN_UNUSED_RESULT | ||||||
Friends | |||||||
class | KuduScanner | ||||||
class | tools::ReplicaDumper | ||||||
class | KuduScanBatch | ||||||
struct | SliceKeysTestSetup | ||||||
struct | IntKeysTestSetup |
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, ...) ... }
regular for loop (C++03):
for (KuduScanBatch::const_iterator it = batch.begin(), it != batch.end(); ++i) { KuduScanBatch::RowPtr row(*it); ... }
or
for (int i = 0, num_rows = batch.NumRows(); i < num_rows; i++) { KuduScanBatch::RowPtr row = batch.Row(i); ... }
KuduScanBatch::const_iterator kudu::client::KuduScanBatch::begin | ( | ) | const [inline] |
const void* kudu::client::KuduScanBatch::cell | ( | int | col_idx | ) | const |
Get the column's row data.
[in] | col_idx | The index of the column. |
KuduScanBatch::const_iterator kudu::client::KuduScanBatch::end | ( | ) | const [inline] |
bool kudu::client::KuduScanBatch::IsNull | ( | int | col_idx | ) | const |
[in] | col_idx | Index of the column. |
true
iff the specified column of the row has NULL
value. bool kudu::client::KuduScanBatch::IsNull | ( | const Slice & | col_name | ) | const |
[in] | col_name | Name of the column. |
true
iff the specified column of the row has NULL
value. int kudu::client::KuduScanBatch::NumRows | ( | ) | const |
bool kudu::client::KuduScanBatch::operator!= | ( | const const_iterator & | other | ) | const [inline] |
An operator to check whether two iterators are 'not equal'.
[in] | other | The iterator to compare with. |
true
iff the other iterator points to a different row in the same batch, or to a row belonging to a different batch altogether. KuduScanBatch::RowPtr kudu::client::KuduScanBatch::operator* | ( | ) | const [inline] |
const_iterator kudu::client::KuduScanBatch::operator++ | ( | int | ) | [inline] |
Postfix increment operator: advances the iterator to the next position.
const_iterator& kudu::client::KuduScanBatch::operator++ | ( | ) | [inline] |
Prefix increment operator: advances the iterator to the next position.
bool kudu::client::KuduScanBatch::operator== | ( | const const_iterator & | other | ) | const [inline] |
An operator to check whether two iterators are 'equal'.
[in] | other | The iterator to compare with. |
true
iff the other iterator points to the same row of the same batch. const KuduSchema* kudu::client::KuduScanBatch::projection_schema | ( | ) | const |
KuduScanBatch::RowPtr kudu::client::KuduScanBatch::Row | ( | int | idx | ) | const |
Get a row at the specified index.
[in] | idx | The index of the row to return. |
kudu::client::KuduScanBatch::RowPtr | ( | ) | [inline] |
Construct an invalid RowPtr. Before use, you must assign a properly-initialized value.
std::string kudu::client::KuduScanBatch::ToString | ( | ) | const |