17#ifndef KUDU_CLIENT_SCAN_BATCH_H
18#define KUDU_CLIENT_SCAN_BATCH_H
28#ifdef KUDU_HEADERS_NO_STUBS
29#include "kudu/gutil/macros.h"
30#include "kudu/gutil/port.h"
32#include "kudu/client/stubs.h"
35#include "kudu/util/int128.h"
36#include "kudu/util/kudu_export.h"
37#include "kudu/util/slice.h"
84class KUDU_EXPORT KuduScanBatch {
155 class KUDU_NO_EXPORT Data;
156 friend class KuduScanner;
157 friend class tools::ReplicaDumper;
160 DISALLOW_COPY_AND_ASSIGN(KuduScanBatch);
168 RowPtr() : schema_(NULL), row_data_(NULL) {}
222 int64_t* micros_since_utc_epoch)
const WARN_UNUSED_RESULT;
235#if KUDU_INT128_SUPPORTED
236 Status GetUnscaledDecimal(
const Slice& col_name, int128_t* val)
const WARN_UNUSED_RESULT;
283 Status GetDate(
int col_idx, int32_t* days_since_unix_epoch)
const WARN_UNUSED_RESULT;
286#if KUDU_INT128_SUPPORTED
287 Status GetUnscaledDecimal(
int col_idx, int128_t* val)
const WARN_UNUSED_RESULT;
343 const void*
cell(
int col_idx)
const;
349 friend class KuduScanBatch;
350 friend class tools::TableScanner;
351 template<
typename KeyTypeWrapper>
friend struct SliceKeysTestSetup;
352 template<
typename KeyTypeWrapper>
friend struct IntKeysTestSetup;
355 RowPtr(
const Schema* schema,
356 const uint8_t* row_data)
358 row_data_(row_data) {
362 Status Get(
const Slice& col_name,
typename T::cpp_type* val)
const;
365 Status Get(
int col_idx,
typename T::cpp_type* val)
const;
367 const Schema* schema_;
368 const uint8_t* row_data_;
377#pragma GCC diagnostic push
378#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
380class KUDU_EXPORT KuduScanBatch::const_iterator
381 :
public std::iterator<std::forward_iterator_tag, KuduScanBatch::RowPtr> {
387 return batch_->Row(idx_);
397 return batch_->Row(idx_);
412 const_iterator tmp(batch_, idx_);
424 return (idx_ == other.idx_) && (batch_ == other.batch_);
435 return !(*
this == other);
439 friend class KuduScanBatch;
448#pragma GCC diagnostic pop
A wrapper around externally allocated data.
Definition slice.h:51
A representation of an operation's outcome.
Definition status.h:191
A handle for a single row in KuduScanBatch.
Definition scan_batch.h:164
Status GetFloat(const Slice &col_name, float *val) const WARN_UNUSED_RESULT
Status GetString(const Slice &col_name, Slice *val) const WARN_UNUSED_RESULT
Status GetInt16(int col_idx, int16_t *val) const WARN_UNUSED_RESULT
Status GetDate(int col_idx, int32_t *days_since_unix_epoch) const WARN_UNUSED_RESULT
Status IsDeleted(bool *val) const WARN_UNUSED_RESULT KUDU_NO_EXPORT
Status GetInt64(int col_idx, int64_t *val) const WARN_UNUSED_RESULT
Status GetInt8(int col_idx, int8_t *val) const WARN_UNUSED_RESULT
bool IsNull(const Slice &col_name) const
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 GetString(int col_idx, Slice *val) const WARN_UNUSED_RESULT
Status GetDouble(int col_idx, double *val) const WARN_UNUSED_RESULT
Status GetInt32(int col_idx, int32_t *val) const WARN_UNUSED_RESULT
std::string ToString() const
Status GetBinary(int col_idx, Slice *val) const WARN_UNUSED_RESULT
Status GetInt8(const Slice &col_name, int8_t *val) const WARN_UNUSED_RESULT
Status GetBool(const Slice &col_name, bool *val) const WARN_UNUSED_RESULT
Status GetBinary(const Slice &col_name, Slice *val) const WARN_UNUSED_RESULT
bool IsNull(int col_idx) const
Status GetVarchar(int col_idx, Slice *val) const WARN_UNUSED_RESULT
Status GetDate(const Slice &col_name, int32_t *days_since_unix_epoch) const WARN_UNUSED_RESULT
const RowPtr * operator->() const
Definition scan_batch.h:174
RowPtr()
Definition scan_batch.h:168
Status GetInt32(const Slice &col_name, int32_t *val) const WARN_UNUSED_RESULT
Status GetBool(int col_idx, bool *val) const WARN_UNUSED_RESULT
Status GetVarchar(const Slice &col_name, Slice *val) const WARN_UNUSED_RESULT
Status GetInt16(const Slice &col_name, int16_t *val) const WARN_UNUSED_RESULT
Status GetUnixTimeMicros(const Slice &col_name, int64_t *micros_since_utc_epoch) const WARN_UNUSED_RESULT
Status GetDouble(const Slice &col_name, double *val) const WARN_UNUSED_RESULT
const void * cell(int col_idx) const
Status GetInt64(const Slice &col_name, int64_t *val) const WARN_UNUSED_RESULT
Iterator to work with immutable KuduScanBatch instances.
Definition scan_batch.h:381
KuduScanBatch::RowPtr operator->() const
Definition scan_batch.h:396
const_iterator & operator++()
Definition scan_batch.h:403
const_iterator operator++(int)
Definition scan_batch.h:411
bool operator!=(const const_iterator &other) const
Definition scan_batch.h:434
bool operator==(const const_iterator &other) const
Definition scan_batch.h:423
KuduScanBatch::RowPtr operator*() const
Definition scan_batch.h:386
A batch of zero or more rows returned by a scan operation.
Definition scan_batch.h:84
Slice direct_data() const
Slice indirect_data() const
KuduScanBatch::RowPtr Row(int idx) const
const_iterator end() const
Definition scan_batch.h:454
const_iterator begin() const
Definition scan_batch.h:450
const KuduSchema * projection_schema() const
RowPtr value_type
A handy typedef for the RowPtr.
Definition scan_batch.h:101
A representation of a table's schema.
Definition schema.h:688