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"
119 const_iterator begin()
const;
121 const_iterator end()
const;
155 class KUDU_NO_EXPORT Data;
157 friend class tools::ReplicaDumper;
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;
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"
380 class 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);
445 const KuduScanBatch*
const batch_;
448 #pragma GCC diagnostic pop
451 return const_iterator(
this, 0);
455 return const_iterator(
this,
NumRows());
A wrapper around externally allocated data.
Definition: slice.h:51
A representation of an operation's outcome.
Definition: status.h:183
A batch of zero or more rows returned by a scan operation.
Definition: scan_batch.h:84
Slice direct_data() const
const KuduSchema * projection_schema() 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
Status GetVarchar(const Slice &col_name, Slice *val) const WARN_UNUSED_RESULT
bool operator!=(const const_iterator &other) const
Definition: scan_batch.h:434
Status IsDeleted(bool *val) const WARN_UNUSED_RESULT KUDU_NO_EXPORT
Status GetBinary(const Slice &col_name, Slice *val) const WARN_UNUSED_RESULT
const void * cell(int col_idx) const
Status GetBool(const Slice &col_name, bool *val) const WARN_UNUSED_RESULT
Slice indirect_data() const
KuduScanBatch::RowPtr Row(int idx) const
Status GetBool(int col_idx, bool *val) const WARN_UNUSED_RESULT
const_iterator operator++(int)
Definition: scan_batch.h:411
Status GetInt64(const Slice &col_name, int64_t *val) const WARN_UNUSED_RESULT
const_iterator end() const
Definition: scan_batch.h:454
KuduScanBatch::RowPtr operator*() const
Definition: scan_batch.h:386
bool IsNull(int col_idx) const
const_iterator begin() const
Definition: scan_batch.h:450
Status GetFloat(const Slice &col_name, float *val) const WARN_UNUSED_RESULT
KuduScanBatch::RowPtr operator->() const
Definition: scan_batch.h:396
bool operator==(const const_iterator &other) const
Definition: scan_batch.h:423
Status GetInt8(const Slice &col_name, int8_t *val) const WARN_UNUSED_RESULT
Status GetDouble(const Slice &col_name, double *val) const WARN_UNUSED_RESULT
Status GetInt8(int col_idx, int8_t *val) const WARN_UNUSED_RESULT
Status GetString(int col_idx, Slice *val) const WARN_UNUSED_RESULT
Status GetBinary(int col_idx, Slice *val) const WARN_UNUSED_RESULT
RowPtr()
Definition: scan_batch.h:168
Status GetDouble(int col_idx, double *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 GetInt16(int col_idx, int16_t *val) const WARN_UNUSED_RESULT
Status GetInt32(const Slice &col_name, int32_t *val) const WARN_UNUSED_RESULT
std::string ToString() const
Status GetUnixTimeMicros(int col_idx, int64_t *micros_since_utc_epoch) const WARN_UNUSED_RESULT
const RowPtr * operator->() const
Definition: scan_batch.h:174
bool IsNull(const Slice &col_name) const
const_iterator & operator++()
Definition: scan_batch.h:403
Status GetString(const Slice &col_name, Slice *val) const WARN_UNUSED_RESULT
Status GetUnixTimeMicros(const Slice &col_name, int64_t *micros_since_utc_epoch) const WARN_UNUSED_RESULT
RowPtr value_type
A handy typedef for the RowPtr.
Definition: scan_batch.h:98
Status GetFloat(int col_idx, float *val) const WARN_UNUSED_RESULT
Status GetInt16(const Slice &col_name, int16_t *val) const WARN_UNUSED_RESULT
Status GetDate(int col_idx, int32_t *days_since_unix_epoch) const WARN_UNUSED_RESULT
This class is a representation of a single scan.
Definition: client.h:2737
A representation of a table's schema.
Definition: schema.h:688