17 #ifndef KUDU_COMMON_PARTIAL_ROW_H    18 #define KUDU_COMMON_PARTIAL_ROW_H    24 #ifdef KUDU_HEADERS_NO_STUBS    25 #include "kudu/gutil/macros.h"    26 #include "kudu/gutil/port.h"    27 #include <gtest/gtest_prod.h>    31 #include "kudu/client/stubs.h"    34 #include "kudu/util/kudu_export.h"    35 #include "kudu/util/slice.h"    41 class KuduWriteOperation;
    42 template<
typename KeyTypeWrapper> 
struct SliceKeysTestSetup;
    43 template<
typename KeyTypeWrapper> 
struct IntKeysTestSetup;
    47   template<
typename KeyTypeWrapper> 
struct SliceTypeRowOps;
    48   template<
typename KeyTypeWrapper> 
struct NumTypeRowOps;
    94   Status SetBool(
const Slice& col_name, 
bool val) WARN_UNUSED_RESULT;
    96   Status SetInt8(
const Slice& col_name, int8_t val) WARN_UNUSED_RESULT;
    97   Status SetInt16(
const Slice& col_name, int16_t val) WARN_UNUSED_RESULT;
    98   Status SetInt32(
const Slice& col_name, int32_t val) WARN_UNUSED_RESULT;
    99   Status SetInt64(
const Slice& col_name, int64_t val) WARN_UNUSED_RESULT;
   100   Status SetUnixTimeMicros(
const Slice& col_name,
   101                            int64_t micros_since_utc_epoch) WARN_UNUSED_RESULT;
   103   Status SetFloat(
const Slice& col_name, 
float val) WARN_UNUSED_RESULT;
   104   Status SetDouble(
const Slice& col_name, 
double val) WARN_UNUSED_RESULT;
   123   Status SetBool(
int col_idx, 
bool val) WARN_UNUSED_RESULT;
   125   Status SetInt8(
int col_idx, int8_t val) WARN_UNUSED_RESULT;
   126   Status SetInt16(
int col_idx, int16_t val) WARN_UNUSED_RESULT;
   127   Status SetInt32(
int col_idx, int32_t val) WARN_UNUSED_RESULT;
   128   Status SetInt64(
int col_idx, int64_t val) WARN_UNUSED_RESULT;
   129   Status SetUnixTimeMicros(
int col_idx, int64_t micros_since_utc_epoch) WARN_UNUSED_RESULT;
   131   Status SetFloat(
int col_idx, 
float val) WARN_UNUSED_RESULT;
   132   Status SetDouble(
int col_idx, 
double val) WARN_UNUSED_RESULT;
   152   Status SetBinary(
const Slice& col_name, 
const Slice& val) WARN_UNUSED_RESULT;
   153   Status SetString(
const Slice& col_name, 
const Slice& val) WARN_UNUSED_RESULT;
   178   Status SetBinary(
int col_idx, 
const Slice& val) WARN_UNUSED_RESULT;
   179   Status SetString(
int col_idx, 
const Slice& val) WARN_UNUSED_RESULT;
   194   Status SetBinaryCopy(
const Slice& col_name, 
const Slice& val) WARN_UNUSED_RESULT;
   195   Status SetStringCopy(
const Slice& col_name, 
const Slice& val) WARN_UNUSED_RESULT;
   215   Status SetStringCopy(
int col_idx, 
const Slice& val) WARN_UNUSED_RESULT;
   216   Status SetBinaryCopy(
int col_idx, 
const Slice& val) WARN_UNUSED_RESULT;
   236   Status SetBinaryNoCopy(
const Slice& col_name, 
const Slice& val) WARN_UNUSED_RESULT;
   237   Status SetStringNoCopy(
const Slice& col_name, 
const Slice& val) WARN_UNUSED_RESULT;
   262   Status SetBinaryNoCopy(
int col_idx, 
const Slice& val) WARN_UNUSED_RESULT;
   263   Status SetStringNoCopy(
int col_idx, 
const Slice& val) WARN_UNUSED_RESULT;
   274   Status SetNull(
const Slice& col_name) WARN_UNUSED_RESULT;
   284   Status SetNull(
int col_idx) WARN_UNUSED_RESULT;
   293   Status Unset(
const Slice& col_name) WARN_UNUSED_RESULT;
   302   Status Unset(
int col_idx) WARN_UNUSED_RESULT;
   309   bool IsColumnSet(
const Slice& col_name) 
const;
   316   bool IsColumnSet(
int col_idx) 
const;
   323   bool IsNull(
const Slice& col_name) 
const;
   330   bool IsNull(
int col_idx) 
const;
   343   Status GetBool(
const Slice& col_name, 
bool* val) 
const WARN_UNUSED_RESULT;
   345   Status GetInt8(
const Slice& col_name, int8_t* val) 
const WARN_UNUSED_RESULT;
   346   Status GetInt16(
const Slice& col_name, int16_t* val) 
const WARN_UNUSED_RESULT;
   347   Status GetInt32(
const Slice& col_name, int32_t* val) 
const WARN_UNUSED_RESULT;
   348   Status GetInt64(
const Slice& col_name, int64_t* val) 
const WARN_UNUSED_RESULT;
   349   Status GetUnixTimeMicros(
const Slice& col_name,
   350                       int64_t* micros_since_utc_epoch) 
const WARN_UNUSED_RESULT;
   352   Status GetFloat(
const Slice& col_name, 
float* val) 
const WARN_UNUSED_RESULT;
   353   Status GetDouble(
const Slice& col_name, 
double* val) 
const WARN_UNUSED_RESULT;
   374   Status GetBool(
int col_idx, 
bool* val) 
const WARN_UNUSED_RESULT;
   376   Status GetInt8(
int col_idx, int8_t* val) 
const WARN_UNUSED_RESULT;
   377   Status GetInt16(
int col_idx, int16_t* val) 
const WARN_UNUSED_RESULT;
   378   Status GetInt32(
int col_idx, int32_t* val) 
const WARN_UNUSED_RESULT;
   379   Status GetInt64(
int col_idx, int64_t* val) 
const WARN_UNUSED_RESULT;
   380   Status GetUnixTimeMicros(
int col_idx, int64_t* micros_since_utc_epoch) 
const WARN_UNUSED_RESULT;
   382   Status GetFloat(
int col_idx, 
float* val) 
const WARN_UNUSED_RESULT;
   383   Status GetDouble(
int col_idx, 
double* val) 
const WARN_UNUSED_RESULT;
   403   Status GetString(
const Slice& col_name, Slice* val) 
const WARN_UNUSED_RESULT;
   404   Status GetBinary(
const Slice& col_name, Slice* val) 
const WARN_UNUSED_RESULT;
   428   Status GetString(
int col_idx, Slice* val) 
const WARN_UNUSED_RESULT;
   429   Status GetBinary(
int col_idx, Slice* val) 
const WARN_UNUSED_RESULT;
   447   Status EncodeRowKey(std::string* encoded_key) 
const;
   455   std::string ToEncodedRowKeyOrDie() 
const;
   463   bool IsKeySet() 
const;
   466   bool AllColumnsSet() 
const;
   473   std::string ToString() 
const;
   476   const Schema* 
schema()
 const { 
return schema_; }
   479   friend class client::KuduWriteOperation;   
   480   friend class KeyUtilTest;
   481   friend class PartitionSchema;
   482   friend class RowOperationsPBDecoder;
   483   friend class RowOperationsPBEncoder;
   484   friend class TestScanSpec;
   485   template<
typename KeyTypeWrapper> 
friend struct client::SliceKeysTestSetup;
   486   template<
typename KeyTypeWrapper> 
friend struct client::IntKeysTestSetup;
   487   template<
typename KeyTypeWrapper> 
friend struct tablet::SliceTypeRowOps;
   488   template<
typename KeyTypeWrapper> 
friend struct tablet::NumTypeRowOps;
   489   FRIEND_TEST(PartitionPrunerTest, TestPrimaryKeyRangePruning);
   490   FRIEND_TEST(PartitionPrunerTest, TestPartialPrimaryKeyRangePruning);
   493   Status Set(
const Slice& col_name, 
const typename T::cpp_type& val,
   497   Status Set(
int col_idx, 
const typename T::cpp_type& val,
   501   Status Set(int32_t column_idx, 
const uint8_t* val);
   504   Status Get(
const Slice& col_name, 
typename T::cpp_type* val) 
const;
   507   Status Get(
int col_idx, 
typename T::cpp_type* val) 
const;
   510   Status SetSliceCopy(
const Slice& col_name, 
const Slice& val);
   513   Status SetSliceCopy(
int col_idx, 
const Slice& val);
   519   void DeallocateStringIfSet(
int col_idx, 
const ColumnSchema& col);
   522   void DeallocateOwnedStrings();
   524   const Schema* schema_;
   529   uint8_t* isset_bitmap_;
   534   uint8_t* owned_strings_bitmap_;
 Definition: callbacks.h:28
 
const Schema * schema() const 
Definition: partial_row.h:476
 
A row which may only contain values for a subset of the columns. 
Definition: partial_row.h:61