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;
88 Status SetBool(
const Slice& col_name,
bool val) WARN_UNUSED_RESULT;
90 Status SetInt8(
const Slice& col_name, int8_t val) WARN_UNUSED_RESULT;
91 Status SetInt16(
const Slice& col_name, int16_t val) WARN_UNUSED_RESULT;
92 Status SetInt32(
const Slice& col_name, int32_t val) WARN_UNUSED_RESULT;
93 Status SetInt64(
const Slice& col_name, int64_t val) WARN_UNUSED_RESULT;
94 Status SetUnixTimeMicros(
const Slice& col_name,
95 int64_t micros_since_utc_epoch) WARN_UNUSED_RESULT;
97 Status SetFloat(
const Slice& col_name,
float val) WARN_UNUSED_RESULT;
98 Status SetDouble(
const Slice& col_name,
double val) WARN_UNUSED_RESULT;
117 Status SetBool(
int col_idx,
bool val) WARN_UNUSED_RESULT;
119 Status SetInt8(
int col_idx, int8_t val) WARN_UNUSED_RESULT;
120 Status SetInt16(
int col_idx, int16_t val) WARN_UNUSED_RESULT;
121 Status SetInt32(
int col_idx, int32_t val) WARN_UNUSED_RESULT;
122 Status SetInt64(
int col_idx, int64_t val) WARN_UNUSED_RESULT;
123 Status SetUnixTimeMicros(
int col_idx, int64_t micros_since_utc_epoch) WARN_UNUSED_RESULT;
125 Status SetFloat(
int col_idx,
float val) WARN_UNUSED_RESULT;
126 Status SetDouble(
int col_idx,
double val) WARN_UNUSED_RESULT;
146 Status SetBinary(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
147 Status SetString(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
172 Status SetBinary(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
173 Status SetString(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
188 Status SetBinaryCopy(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
189 Status SetStringCopy(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
209 Status SetStringCopy(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
210 Status SetBinaryCopy(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
230 Status SetBinaryNoCopy(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
231 Status SetStringNoCopy(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
256 Status SetBinaryNoCopy(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
257 Status SetStringNoCopy(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
268 Status SetNull(
const Slice& col_name) WARN_UNUSED_RESULT;
278 Status SetNull(
int col_idx) WARN_UNUSED_RESULT;
287 Status Unset(
const Slice& col_name) WARN_UNUSED_RESULT;
296 Status Unset(
int col_idx) WARN_UNUSED_RESULT;
303 bool IsColumnSet(
const Slice& col_name)
const;
310 bool IsColumnSet(
int col_idx)
const;
317 bool IsNull(
const Slice& col_name)
const;
324 bool IsNull(
int col_idx)
const;
337 Status GetBool(
const Slice& col_name,
bool* val)
const WARN_UNUSED_RESULT;
339 Status GetInt8(
const Slice& col_name, int8_t* val)
const WARN_UNUSED_RESULT;
340 Status GetInt16(
const Slice& col_name, int16_t* val)
const WARN_UNUSED_RESULT;
341 Status GetInt32(
const Slice& col_name, int32_t* val)
const WARN_UNUSED_RESULT;
342 Status GetInt64(
const Slice& col_name, int64_t* val)
const WARN_UNUSED_RESULT;
343 Status GetUnixTimeMicros(
const Slice& col_name,
344 int64_t* micros_since_utc_epoch)
const WARN_UNUSED_RESULT;
346 Status GetFloat(
const Slice& col_name,
float* val)
const WARN_UNUSED_RESULT;
347 Status GetDouble(
const Slice& col_name,
double* val)
const WARN_UNUSED_RESULT;
368 Status GetBool(
int col_idx,
bool* val)
const WARN_UNUSED_RESULT;
370 Status GetInt8(
int col_idx, int8_t* val)
const WARN_UNUSED_RESULT;
371 Status GetInt16(
int col_idx, int16_t* val)
const WARN_UNUSED_RESULT;
372 Status GetInt32(
int col_idx, int32_t* val)
const WARN_UNUSED_RESULT;
373 Status GetInt64(
int col_idx, int64_t* val)
const WARN_UNUSED_RESULT;
374 Status GetUnixTimeMicros(
int col_idx, int64_t* micros_since_utc_epoch)
const WARN_UNUSED_RESULT;
376 Status GetFloat(
int col_idx,
float* val)
const WARN_UNUSED_RESULT;
377 Status GetDouble(
int col_idx,
double* val)
const WARN_UNUSED_RESULT;
397 Status GetString(
const Slice& col_name, Slice* val)
const WARN_UNUSED_RESULT;
398 Status GetBinary(
const Slice& col_name, Slice* val)
const WARN_UNUSED_RESULT;
422 Status GetString(
int col_idx, Slice* val)
const WARN_UNUSED_RESULT;
423 Status GetBinary(
int col_idx, Slice* val)
const WARN_UNUSED_RESULT;
441 Status EncodeRowKey(std::string* encoded_key)
const;
449 std::string ToEncodedRowKeyOrDie()
const;
457 bool IsKeySet()
const;
460 bool AllColumnsSet()
const;
467 std::string ToString()
const;
470 const Schema*
schema()
const {
return schema_; }
473 friend class client::KuduWriteOperation;
474 friend class KeyUtilTest;
475 friend class PartitionSchema;
476 friend class RowOperationsPBDecoder;
477 friend class RowOperationsPBEncoder;
478 friend class TestScanSpec;
479 template<
typename KeyTypeWrapper>
friend struct client::SliceKeysTestSetup;
480 template<
typename KeyTypeWrapper>
friend struct client::IntKeysTestSetup;
481 FRIEND_TEST(TestPartitionPruner, TestPrimaryKeyRangePruning);
482 FRIEND_TEST(TestPartitionPruner, TestPartialPrimaryKeyRangePruning);
485 Status Set(
const Slice& col_name,
const typename T::cpp_type& val,
489 Status Set(
int col_idx,
const typename T::cpp_type& val,
493 Status Set(int32_t column_idx,
const uint8_t* val);
496 Status Get(
const Slice& col_name,
typename T::cpp_type* val)
const;
499 Status Get(
int col_idx,
typename T::cpp_type* val)
const;
502 Status SetSliceCopy(
const Slice& col_name,
const Slice& val);
505 Status SetSliceCopy(
int col_idx,
const Slice& val);
511 void DeallocateStringIfSet(
int col_idx,
const ColumnSchema& col);
514 void DeallocateOwnedStrings();
516 const Schema* schema_;
521 uint8_t* isset_bitmap_;
526 uint8_t* owned_strings_bitmap_;
Definition: callbacks.h:28
const Schema * schema() const
Definition: partial_row.h:470
A row which may only contain values for a subset of the columns.
Definition: partial_row.h:55