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/kudu_export.h" 36 #include "kudu/util/slice.h" 114 KuduScanBatch::RowPtr Row(
int idx)
const;
117 const_iterator begin()
const;
119 const_iterator end()
const;
140 Slice direct_data()
const;
145 Slice indirect_data()
const;
149 class KUDU_NO_EXPORT Data;
151 friend class tools::ReplicaDumper;
161 RowPtr() : schema_(NULL), row_data_(NULL) {}
166 bool IsNull(
const Slice& col_name)
const;
171 bool IsNull(
int col_idx)
const;
186 Status GetBool(
const Slice& col_name,
bool* val)
const WARN_UNUSED_RESULT;
188 Status GetInt8(
const Slice& col_name, int8_t* val)
const WARN_UNUSED_RESULT;
189 Status GetInt16(
const Slice& col_name, int16_t* val)
const WARN_UNUSED_RESULT;
190 Status GetInt32(
const Slice& col_name, int32_t* val)
const WARN_UNUSED_RESULT;
191 Status GetInt64(
const Slice& col_name, int64_t* val)
const WARN_UNUSED_RESULT;
192 Status GetUnixTimeMicros(
const Slice& col_name, int64_t* micros_since_utc_epoch)
193 const WARN_UNUSED_RESULT;
195 Status GetFloat(
const Slice& col_name,
float* val)
const WARN_UNUSED_RESULT;
196 Status GetDouble(
const Slice& col_name,
double* val)
const WARN_UNUSED_RESULT;
217 Status GetBool(
int col_idx,
bool* val)
const WARN_UNUSED_RESULT;
219 Status GetInt8(
int col_idx, int8_t* val)
const WARN_UNUSED_RESULT;
220 Status GetInt16(
int col_idx, int16_t* val)
const WARN_UNUSED_RESULT;
221 Status GetInt32(
int col_idx, int32_t* val)
const WARN_UNUSED_RESULT;
222 Status GetInt64(
int col_idx, int64_t* val)
const WARN_UNUSED_RESULT;
223 Status GetUnixTimeMicros(
int col_idx, int64_t* micros_since_utc_epoch)
const WARN_UNUSED_RESULT;
225 Status GetFloat(
int col_idx,
float* val)
const WARN_UNUSED_RESULT;
226 Status GetDouble(
int col_idx,
double* val)
const WARN_UNUSED_RESULT;
246 Status GetString(
const Slice& col_name,
Slice* val)
const WARN_UNUSED_RESULT;
247 Status GetBinary(
const Slice& col_name,
Slice* val)
const WARN_UNUSED_RESULT;
271 Status GetString(
int col_idx,
Slice* val)
const WARN_UNUSED_RESULT;
272 Status GetBinary(
int col_idx,
Slice* val)
const WARN_UNUSED_RESULT;
281 const void* cell(
int col_idx)
const;
284 std::string ToString()
const;
288 template<
typename KeyTypeWrapper>
friend struct SliceKeysTestSetup;
289 template<
typename KeyTypeWrapper>
friend struct IntKeysTestSetup;
292 RowPtr(
const Schema* schema,
293 const uint8_t* row_data)
295 row_data_(row_data) {
299 Status Get(
const Slice& col_name,
typename T::cpp_type* val)
const;
302 Status Get(
int col_idx,
typename T::cpp_type* val)
const;
304 const Schema* schema_;
305 const uint8_t* row_data_;
308 class KUDU_EXPORT KuduScanBatch::const_iterator
309 :
public std::iterator<std::forward_iterator_tag, KuduScanBatch::RowPtr> {
315 return batch_->Row(idx_);
330 const_iterator tmp(batch_, idx_);
342 return (idx_ == other.idx_) && (batch_ == other.batch_);
353 return !(*
this == other);
357 friend class KuduScanBatch;
358 const_iterator(
const KuduScanBatch* b,
int idx)
363 const KuduScanBatch*
const batch_;
368 inline KuduScanBatch::const_iterator KuduScanBatch::begin()
const {
369 return const_iterator(
this, 0);
372 inline KuduScanBatch::const_iterator KuduScanBatch::end()
const {
373 return const_iterator(
this, NumRows());
A representation of a table's schema.
Definition: schema.h:431
A representation of an operation's outcome.
Definition: status.h:145
Definition: callbacks.h:28
RowPtr value_type
A handy typedef for the RowPtr.
Definition: scan_batch.h:96
RowPtr()
Definition: scan_batch.h:161
KuduScanBatch::RowPtr operator*() const
Definition: scan_batch.h:314
A wrapper around externally allocated data.
Definition: slice.h:47
This class is a representation of a single scan.
Definition: client.h:1705
bool operator==(const const_iterator &other) const
Definition: scan_batch.h:341
const_iterator operator++(int)
Definition: scan_batch.h:329
bool operator!=(const const_iterator &other) const
Definition: scan_batch.h:352
const_iterator & operator++()
Definition: scan_batch.h:321
A batch of zero or more rows returned by a scan operation.
Definition: scan_batch.h:82