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"
116 KuduScanBatch::RowPtr
Row(
int idx)
const;
119 const_iterator begin()
const;
121 const_iterator end()
const;
155 class KUDU_NO_EXPORT Data;
157 friend class tools::ReplicaDumper;
167 RowPtr() : schema_(NULL), row_data_(NULL) {}
221 int64_t* micros_since_utc_epoch)
const WARN_UNUSED_RESULT;
234#if KUDU_INT128_SUPPORTED
235 Status GetUnscaledDecimal(
const Slice& col_name, int128_t* val)
const WARN_UNUSED_RESULT;
282 Status GetDate(
int col_idx, int32_t* days_since_unix_epoch)
const WARN_UNUSED_RESULT;
285#if KUDU_INT128_SUPPORTED
286 Status GetUnscaledDecimal(
int col_idx, int128_t* val)
const WARN_UNUSED_RESULT;
342 const void*
cell(
int col_idx)
const;
349 friend class tools::TableScanner;
350 template<
typename KeyTypeWrapper>
friend struct SliceKeysTestSetup;
351 template<
typename KeyTypeWrapper>
friend struct IntKeysTestSetup;
354 RowPtr(
const Schema* schema,
355 const uint8_t* row_data)
357 row_data_(row_data) {
361 Status Get(
const Slice& col_name,
typename T::cpp_type* val)
const;
364 Status Get(
int col_idx,
typename T::cpp_type* val)
const;
366 const Schema* schema_;
367 const uint8_t* row_data_;
370class KUDU_EXPORT KuduScanBatch::const_iterator
371 :
public std::iterator<std::forward_iterator_tag, KuduScanBatch::RowPtr> {
377 return batch_->Row(idx_);
387 return batch_->Row(idx_);
402 const_iterator tmp(batch_, idx_);
414 return (idx_ == other.idx_) && (batch_ == other.batch_);
425 return !(*
this == other);
435 const KuduScanBatch*
const batch_;
441 return const_iterator(
this, 0);
445 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:165
A batch of zero or more rows returned by a scan operation.
Definition scan_batch.h:84
Slice direct_data() const
Status GetVarchar(int col_idx, Slice *val) const WARN_UNUSED_RESULT
const RowPtr * operator->() const
Definition scan_batch.h:173
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:424
Status IsDeleted(bool *val) const WARN_UNUSED_RESULT KUDU_NO_EXPORT
Status GetBinary(const Slice &col_name, Slice *val) const WARN_UNUSED_RESULT
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:401
Status GetInt64(const Slice &col_name, int64_t *val) const WARN_UNUSED_RESULT
const_iterator end() const
Definition scan_batch.h:444
KuduScanBatch::RowPtr operator*() const
Definition scan_batch.h:376
bool IsNull(int col_idx) const
const_iterator & operator++()
Definition scan_batch.h:393
const_iterator begin() const
Definition scan_batch.h:440
Status GetFloat(const Slice &col_name, float *val) const WARN_UNUSED_RESULT
KuduScanBatch::RowPtr operator->() const
Definition scan_batch.h:386
bool operator==(const const_iterator &other) const
Definition scan_batch.h:413
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:167
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
bool IsNull(const Slice &col_name) const
const KuduSchema * projection_schema() const
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:101
Status GetFloat(int col_idx, float *val) const WARN_UNUSED_RESULT
const void * cell(int col_idx) const
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:2712
A representation of a table's schema.
Definition schema.h:688