17 #ifndef KUDU_CLIENT_SCAN_BATCH_H 18 #define KUDU_CLIENT_SCAN_BATCH_H 22 #ifdef KUDU_HEADERS_NO_STUBS 23 #include "kudu/gutil/macros.h" 24 #include "kudu/gutil/port.h" 26 #include "kudu/client/stubs.h" 29 #include "kudu/util/kudu_export.h" 30 #include "kudu/util/slice.h" 107 KuduScanBatch::RowPtr Row(
int idx)
const;
110 const_iterator begin()
const;
112 const_iterator end()
const;
133 Slice direct_data()
const;
138 Slice indirect_data()
const;
142 class KUDU_NO_EXPORT Data;
144 friend class tools::ReplicaDumper;
154 RowPtr() : schema_(NULL), row_data_(NULL) {}
159 bool IsNull(
const Slice& col_name)
const;
164 bool IsNull(
int col_idx)
const;
179 Status GetBool(
const Slice& col_name,
bool* val)
const WARN_UNUSED_RESULT;
181 Status GetInt8(
const Slice& col_name, int8_t* val)
const WARN_UNUSED_RESULT;
182 Status GetInt16(
const Slice& col_name, int16_t* val)
const WARN_UNUSED_RESULT;
183 Status GetInt32(
const Slice& col_name, int32_t* val)
const WARN_UNUSED_RESULT;
184 Status GetInt64(
const Slice& col_name, int64_t* val)
const WARN_UNUSED_RESULT;
185 Status GetUnixTimeMicros(
const Slice& col_name, int64_t* micros_since_utc_epoch)
186 const WARN_UNUSED_RESULT;
188 Status GetFloat(
const Slice& col_name,
float* val)
const WARN_UNUSED_RESULT;
189 Status GetDouble(
const Slice& col_name,
double* val)
const WARN_UNUSED_RESULT;
210 Status GetBool(
int col_idx,
bool* val)
const WARN_UNUSED_RESULT;
212 Status GetInt8(
int col_idx, int8_t* val)
const WARN_UNUSED_RESULT;
213 Status GetInt16(
int col_idx, int16_t* val)
const WARN_UNUSED_RESULT;
214 Status GetInt32(
int col_idx, int32_t* val)
const WARN_UNUSED_RESULT;
215 Status GetInt64(
int col_idx, int64_t* val)
const WARN_UNUSED_RESULT;
216 Status GetUnixTimeMicros(
int col_idx, int64_t* micros_since_utc_epoch)
const WARN_UNUSED_RESULT;
218 Status GetFloat(
int col_idx,
float* val)
const WARN_UNUSED_RESULT;
219 Status GetDouble(
int col_idx,
double* val)
const WARN_UNUSED_RESULT;
239 Status GetString(
const Slice& col_name,
Slice* val)
const WARN_UNUSED_RESULT;
240 Status GetBinary(
const Slice& col_name,
Slice* val)
const WARN_UNUSED_RESULT;
264 Status GetString(
int col_idx,
Slice* val)
const WARN_UNUSED_RESULT;
265 Status GetBinary(
int col_idx,
Slice* val)
const WARN_UNUSED_RESULT;
274 const void* cell(
int col_idx)
const;
277 std::string ToString()
const;
281 template<
typename KeyTypeWrapper>
friend struct SliceKeysTestSetup;
282 template<
typename KeyTypeWrapper>
friend struct IntKeysTestSetup;
285 RowPtr(
const Schema* schema,
286 const uint8_t* row_data)
288 row_data_(row_data) {
292 Status Get(
const Slice& col_name,
typename T::cpp_type* val)
const;
295 Status Get(
int col_idx,
typename T::cpp_type* val)
const;
297 const Schema* schema_;
298 const uint8_t* row_data_;
301 class KUDU_EXPORT KuduScanBatch::const_iterator
302 :
public std::iterator<std::forward_iterator_tag, KuduScanBatch::RowPtr> {
308 return batch_->Row(idx_);
323 const_iterator tmp(batch_, idx_);
335 return (idx_ == other.idx_) && (batch_ == other.batch_);
346 return !(*
this == other);
350 friend class KuduScanBatch;
351 const_iterator(
const KuduScanBatch* b,
int idx)
356 const KuduScanBatch*
const batch_;
361 inline KuduScanBatch::const_iterator KuduScanBatch::begin()
const {
362 return const_iterator(
this, 0);
365 inline KuduScanBatch::const_iterator KuduScanBatch::end()
const {
366 return const_iterator(
this, NumRows());
A representation of a table's schema.
Definition: schema.h:423
A representation of an operation's outcome.
Definition: status.h:130
Definition: callbacks.h:28
RowPtr value_type
A handy typedef for the RowPtr.
Definition: scan_batch.h:89
RowPtr()
Definition: scan_batch.h:154
KuduScanBatch::RowPtr operator*() const
Definition: scan_batch.h:307
A wrapper around externally allocated data.
Definition: slice.h:43
This class is a representation of a single scan.
Definition: client.h:1695
bool operator==(const const_iterator &other) const
Definition: scan_batch.h:334
const_iterator operator++(int)
Definition: scan_batch.h:322
bool operator!=(const const_iterator &other) const
Definition: scan_batch.h:345
const_iterator & operator++()
Definition: scan_batch.h:314
A batch of zero or more rows returned by a scan operation.
Definition: scan_batch.h:75