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"
118 const_iterator begin()
const;
120 const_iterator end()
const;
141 Slice direct_data()
const;
146 Slice indirect_data()
const;
150 class KUDU_NO_EXPORT Data;
152 friend class tools::ReplicaDumper;
162 RowPtr() : schema_(NULL), row_data_(NULL) {}
167 bool IsNull(
const Slice& col_name)
const;
172 bool IsNull(
int col_idx)
const;
187 Status GetBool(
const Slice& col_name,
bool* val)
const WARN_UNUSED_RESULT;
189 Status GetInt8(
const Slice& col_name, int8_t* val)
const WARN_UNUSED_RESULT;
190 Status GetInt16(
const Slice& col_name, int16_t* val)
const WARN_UNUSED_RESULT;
191 Status GetInt32(
const Slice& col_name, int32_t* val)
const WARN_UNUSED_RESULT;
192 Status GetInt64(
const Slice& col_name, int64_t* val)
const WARN_UNUSED_RESULT;
193 Status GetUnixTimeMicros(
const Slice& col_name, int64_t* micros_since_utc_epoch)
194 const WARN_UNUSED_RESULT;
196 Status GetFloat(
const Slice& col_name,
float* val)
const WARN_UNUSED_RESULT;
197 Status GetDouble(
const Slice& col_name,
double* val)
const WARN_UNUSED_RESULT;
199 #if KUDU_INT128_SUPPORTED
200 Status GetUnscaledDecimal(
const Slice& col_name, int128_t* val)
const WARN_UNUSED_RESULT;
222 Status GetBool(
int col_idx,
bool* val)
const WARN_UNUSED_RESULT;
224 Status GetInt8(
int col_idx, int8_t* val)
const WARN_UNUSED_RESULT;
225 Status GetInt16(
int col_idx, int16_t* val)
const WARN_UNUSED_RESULT;
226 Status GetInt32(
int col_idx, int32_t* val)
const WARN_UNUSED_RESULT;
227 Status GetInt64(
int col_idx, int64_t* val)
const WARN_UNUSED_RESULT;
228 Status GetUnixTimeMicros(
int col_idx, int64_t* micros_since_utc_epoch)
const WARN_UNUSED_RESULT;
230 Status GetFloat(
int col_idx,
float* val)
const WARN_UNUSED_RESULT;
231 Status GetDouble(
int col_idx,
double* val)
const WARN_UNUSED_RESULT;
233 #if KUDU_INT128_SUPPORTED
234 Status GetUnscaledDecimal(
int col_idx, int128_t* val)
const WARN_UNUSED_RESULT;
255 Status GetString(
const Slice& col_name,
Slice* val)
const WARN_UNUSED_RESULT;
256 Status GetBinary(
const Slice& col_name,
Slice* val)
const WARN_UNUSED_RESULT;
280 Status GetString(
int col_idx,
Slice* val)
const WARN_UNUSED_RESULT;
281 Status GetBinary(
int col_idx,
Slice* val)
const WARN_UNUSED_RESULT;
290 const void* cell(
int col_idx)
const;
293 std::string ToString()
const;
297 template<
typename KeyTypeWrapper>
friend struct SliceKeysTestSetup;
298 template<
typename KeyTypeWrapper>
friend struct IntKeysTestSetup;
301 RowPtr(
const Schema* schema,
302 const uint8_t* row_data)
304 row_data_(row_data) {
308 Status Get(
const Slice& col_name,
typename T::cpp_type* val)
const;
311 Status Get(
int col_idx,
typename T::cpp_type* val)
const;
313 const Schema* schema_;
314 const uint8_t* row_data_;
317 class KUDU_EXPORT KuduScanBatch::const_iterator
318 :
public std::iterator<std::forward_iterator_tag, KuduScanBatch::RowPtr> {
324 return batch_->Row(idx_);
339 const_iterator tmp(batch_, idx_);
351 return (idx_ == other.idx_) && (batch_ == other.batch_);
362 return !(*
this == other);
372 const KuduScanBatch*
const batch_;
378 return const_iterator(
this, 0);
382 return const_iterator(
this,
NumRows());
A representation of a table's schema.
Definition: schema.h:497
A representation of an operation's outcome.
Definition: status.h:145
const_iterator begin() const
Definition: scan_batch.h:377
RowPtr value_type
A handy typedef for the RowPtr.
Definition: scan_batch.h:97
RowPtr()
Definition: scan_batch.h:162
KuduScanBatch::RowPtr operator*() const
Definition: scan_batch.h:323
A wrapper around externally allocated data.
Definition: slice.h:47
This class is a representation of a single scan.
Definition: client.h:1706
bool operator==(const const_iterator &other) const
Definition: scan_batch.h:350
const_iterator operator++(int)
Definition: scan_batch.h:338
bool operator!=(const const_iterator &other) const
Definition: scan_batch.h:361
const_iterator & operator++()
Definition: scan_batch.h:330
const_iterator end() const
Definition: scan_batch.h:381
A batch of zero or more rows returned by a scan operation.
Definition: scan_batch.h:83