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;
 
  142   Slice direct_data() 
const;
 
  147   Slice indirect_data() 
const;
 
  151   class KUDU_NO_EXPORT Data;
 
  153   friend class tools::ReplicaDumper;
 
  163   RowPtr() : schema_(NULL), row_data_(NULL) {}
 
  168   bool IsNull(
const Slice& col_name) 
const;
 
  173   bool IsNull(
int col_idx) 
const;
 
  181   Status IsDeleted(
bool* val) 
const WARN_UNUSED_RESULT KUDU_NO_EXPORT;
 
  196   Status GetBool(
const Slice& col_name, 
bool* val) 
const WARN_UNUSED_RESULT;
 
  198   Status GetInt8(
const Slice& col_name, int8_t* val) 
const WARN_UNUSED_RESULT;
 
  199   Status GetInt16(
const Slice& col_name, int16_t* val) 
const WARN_UNUSED_RESULT;
 
  200   Status GetInt32(
const Slice& col_name, int32_t* val) 
const WARN_UNUSED_RESULT;
 
  201   Status GetInt64(
const Slice& col_name, int64_t* val) 
const WARN_UNUSED_RESULT;
 
  202   Status GetUnixTimeMicros(
const Slice& col_name, int64_t* micros_since_utc_epoch)
 
  203     const WARN_UNUSED_RESULT;
 
  205   Status GetFloat(
const Slice& col_name, 
float* val) 
const WARN_UNUSED_RESULT;
 
  206   Status GetDouble(
const Slice& col_name, 
double* val) 
const WARN_UNUSED_RESULT;
 
  208 #if KUDU_INT128_SUPPORTED 
  209   Status GetUnscaledDecimal(
const Slice& col_name, int128_t* val) 
const WARN_UNUSED_RESULT;
 
  231   Status GetBool(
int col_idx, 
bool* val) 
const WARN_UNUSED_RESULT;
 
  233   Status GetInt8(
int col_idx, int8_t* val) 
const WARN_UNUSED_RESULT;
 
  234   Status GetInt16(
int col_idx, int16_t* val) 
const WARN_UNUSED_RESULT;
 
  235   Status GetInt32(
int col_idx, int32_t* val) 
const WARN_UNUSED_RESULT;
 
  236   Status GetInt64(
int col_idx, int64_t* val) 
const WARN_UNUSED_RESULT;
 
  237   Status GetUnixTimeMicros(
int col_idx, int64_t* micros_since_utc_epoch) 
const WARN_UNUSED_RESULT;
 
  239   Status GetFloat(
int col_idx, 
float* val) 
const WARN_UNUSED_RESULT;
 
  240   Status GetDouble(
int col_idx, 
double* val) 
const WARN_UNUSED_RESULT;
 
  242 #if KUDU_INT128_SUPPORTED 
  243   Status GetUnscaledDecimal(
int col_idx, int128_t* val) 
const WARN_UNUSED_RESULT;
 
  264   Status GetString(
const Slice& col_name, 
Slice* val) 
const WARN_UNUSED_RESULT;
 
  265   Status GetBinary(
const Slice& col_name, 
Slice* val) 
const WARN_UNUSED_RESULT;
 
  289   Status GetString(
int col_idx, 
Slice* val) 
const WARN_UNUSED_RESULT;
 
  290   Status GetBinary(
int col_idx, 
Slice* val) 
const WARN_UNUSED_RESULT;
 
  299   const void* cell(
int col_idx) 
const;
 
  302   std::string ToString() 
const;
 
  306   friend class tools::TableScanner;
 
  307   template<
typename KeyTypeWrapper> 
friend struct SliceKeysTestSetup;
 
  308   template<
typename KeyTypeWrapper> 
friend struct IntKeysTestSetup;
 
  311   RowPtr(
const Schema* schema,
 
  312          const uint8_t* row_data)
 
  314         row_data_(row_data) {
 
  318   Status Get(
const Slice& col_name, 
typename T::cpp_type* val) 
const;
 
  321   Status Get(
int col_idx, 
typename T::cpp_type* val) 
const;
 
  323   const Schema* schema_;
 
  324   const uint8_t* row_data_;
 
  327 class KUDU_EXPORT KuduScanBatch::const_iterator
 
  328     : 
public std::iterator<std::forward_iterator_tag, KuduScanBatch::RowPtr> {
 
  334     return batch_->Row(idx_);
 
  349     const_iterator tmp(batch_, idx_);
 
  361     return (idx_ == other.idx_) && (batch_ == other.batch_);
 
  372     return !(*
this == other);
 
  382   const KuduScanBatch* 
const batch_;
 
  388   return const_iterator(
this, 0);
 
  392   return const_iterator(
this, 
NumRows());
 
A representation of a table's schema. 
Definition: schema.h:531
 
A representation of an operation's outcome. 
Definition: status.h:145
 
const_iterator begin() const 
Definition: scan_batch.h:387
 
RowPtr value_type
A handy typedef for the RowPtr. 
Definition: scan_batch.h:98
 
RowPtr()
Definition: scan_batch.h:163
 
KuduScanBatch::RowPtr operator*() const 
Definition: scan_batch.h:333
 
A wrapper around externally allocated data. 
Definition: slice.h:50
 
This class is a representation of a single scan. 
Definition: client.h:1832
 
bool operator==(const const_iterator &other) const 
Definition: scan_batch.h:360
 
const_iterator operator++(int)
Definition: scan_batch.h:348
 
bool operator!=(const const_iterator &other) const 
Definition: scan_batch.h:371
 
const_iterator & operator++()
Definition: scan_batch.h:340
 
const_iterator end() const 
Definition: scan_batch.h:391
 
A batch of zero or more rows returned by a scan operation. 
Definition: scan_batch.h:84