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"
40 class KuduWriteOperation;
86 Status SetBool(
const Slice& col_name,
bool val) WARN_UNUSED_RESULT;
88 Status SetInt8(
const Slice& col_name, int8_t val) WARN_UNUSED_RESULT;
89 Status SetInt16(
const Slice& col_name, int16_t val) WARN_UNUSED_RESULT;
90 Status SetInt32(
const Slice& col_name, int32_t val) WARN_UNUSED_RESULT;
91 Status SetInt64(
const Slice& col_name, int64_t val) WARN_UNUSED_RESULT;
92 Status SetTimestamp(
const Slice& col_name, int64_t micros_since_utc_epoch) WARN_UNUSED_RESULT;
94 Status SetFloat(
const Slice& col_name,
float val) WARN_UNUSED_RESULT;
95 Status SetDouble(
const Slice& col_name,
double val) WARN_UNUSED_RESULT;
114 Status SetBool(
int col_idx,
bool val) WARN_UNUSED_RESULT;
116 Status SetInt8(
int col_idx, int8_t val) WARN_UNUSED_RESULT;
117 Status SetInt16(
int col_idx, int16_t val) WARN_UNUSED_RESULT;
118 Status SetInt32(
int col_idx, int32_t val) WARN_UNUSED_RESULT;
119 Status SetInt64(
int col_idx, int64_t val) WARN_UNUSED_RESULT;
120 Status SetTimestamp(
int col_idx, int64_t micros_since_utc_epoch) WARN_UNUSED_RESULT;
122 Status SetFloat(
int col_idx,
float val) WARN_UNUSED_RESULT;
123 Status SetDouble(
int col_idx,
double val) WARN_UNUSED_RESULT;
143 Status SetBinary(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
144 Status SetString(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
169 Status SetBinary(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
170 Status SetString(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
185 Status SetBinaryCopy(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
186 Status SetStringCopy(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
206 Status SetStringCopy(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
207 Status SetBinaryCopy(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
227 Status SetBinaryNoCopy(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
228 Status SetStringNoCopy(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
253 Status SetBinaryNoCopy(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
254 Status SetStringNoCopy(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
265 Status SetNull(
const Slice& col_name) WARN_UNUSED_RESULT;
275 Status SetNull(
int col_idx) WARN_UNUSED_RESULT;
284 Status Unset(
const Slice& col_name) WARN_UNUSED_RESULT;
293 Status Unset(
int col_idx) WARN_UNUSED_RESULT;
300 bool IsColumnSet(
const Slice& col_name)
const;
307 bool IsColumnSet(
int col_idx)
const;
314 bool IsNull(
const Slice& col_name)
const;
321 bool IsNull(
int col_idx)
const;
334 Status GetBool(
const Slice& col_name,
bool* val)
const WARN_UNUSED_RESULT;
336 Status GetInt8(
const Slice& col_name, int8_t* val)
const WARN_UNUSED_RESULT;
337 Status GetInt16(
const Slice& col_name, int16_t* val)
const WARN_UNUSED_RESULT;
338 Status GetInt32(
const Slice& col_name, int32_t* val)
const WARN_UNUSED_RESULT;
339 Status GetInt64(
const Slice& col_name, int64_t* val)
const WARN_UNUSED_RESULT;
341 int64_t* micros_since_utc_epoch)
const WARN_UNUSED_RESULT;
343 Status GetFloat(
const Slice& col_name,
float* val)
const WARN_UNUSED_RESULT;
344 Status GetDouble(
const Slice& col_name,
double* val)
const WARN_UNUSED_RESULT;
365 Status GetBool(
int col_idx,
bool* val)
const WARN_UNUSED_RESULT;
367 Status GetInt8(
int col_idx, int8_t* val)
const WARN_UNUSED_RESULT;
368 Status GetInt16(
int col_idx, int16_t* val)
const WARN_UNUSED_RESULT;
369 Status GetInt32(
int col_idx, int32_t* val)
const WARN_UNUSED_RESULT;
370 Status GetInt64(
int col_idx, int64_t* val)
const WARN_UNUSED_RESULT;
371 Status GetTimestamp(
int col_idx, int64_t* micros_since_utc_epoch)
const WARN_UNUSED_RESULT;
373 Status GetFloat(
int col_idx,
float* val)
const WARN_UNUSED_RESULT;
374 Status GetDouble(
int col_idx,
double* val)
const WARN_UNUSED_RESULT;
394 Status GetString(
const Slice& col_name,
Slice* val)
const WARN_UNUSED_RESULT;
395 Status GetBinary(
const Slice& col_name,
Slice* val)
const WARN_UNUSED_RESULT;
419 Status GetString(
int col_idx,
Slice* val)
const WARN_UNUSED_RESULT;
420 Status GetBinary(
int col_idx,
Slice* val)
const WARN_UNUSED_RESULT;
438 Status EncodeRowKey(std::string* encoded_key)
const;
446 std::string ToEncodedRowKeyOrDie()
const;
454 bool IsKeySet()
const;
457 bool AllColumnsSet()
const;
460 std::string ToString()
const;
463 const Schema*
schema()
const {
return schema_; }
467 friend class KeyUtilTest;
468 friend class PartitionSchema;
469 friend class RowOperationsPBDecoder;
470 friend class RowOperationsPBEncoder;
471 friend class TestScanSpec;
474 FRIEND_TEST(TestPartitionPruner, TestPrimaryKeyRangePruning);
475 FRIEND_TEST(TestPartitionPruner, TestPartialPrimaryKeyRangePruning);
478 Status Set(
const Slice& col_name,
const typename T::cpp_type& val,
482 Status Set(
int col_idx,
const typename T::cpp_type& val,
486 Status Set(int32_t column_idx,
const uint8_t* val);
489 Status Get(
const Slice& col_name,
typename T::cpp_type* val)
const;
492 Status Get(
int col_idx,
typename T::cpp_type* val)
const;
498 Status SetSliceCopy(
int col_idx,
const Slice& val);
504 void DeallocateStringIfSet(
int col_idx,
const ColumnSchema& col);
507 void DeallocateOwnedStrings();
509 const Schema* schema_;
514 uint8_t* isset_bitmap_;
519 uint8_t* owned_strings_bitmap_;
A representation of an operation's outcome.
Definition: status.h:106
Definition: partial_row.h:42
Definition: partial_row.h:41
A wrapper around externally allocated data.
Definition: slice.h:43
const Schema * schema() const
Definition: partial_row.h:463
A single-row write operation to be sent to a Kudu table.
Definition: write_op.h:55
A row which may only contain values for a subset of the columns.
Definition: partial_row.h:53