[OBKV] add enum placeholder for hbase secondary partition
This commit is contained in:
@ -1227,18 +1227,18 @@ public:
|
||||
void set_deserialize_allocator(common::ObIAllocator *allocator);
|
||||
void set_entity_factory(ObITableEntityFactory *entity_factory);
|
||||
|
||||
bool is_check_and_execute() const override { return is_check_and_execute_; }
|
||||
bool is_check_exists() const override { return is_check_and_execute_ && !is_check_no_exists_; }
|
||||
bool rollback_when_check_failed() const override { return is_check_and_execute_ && rollback_when_check_failed_; }
|
||||
bool is_check_and_execute() const override { return table_flag_.is_check_and_execute_; }
|
||||
bool is_check_exists() const override { return table_flag_.is_check_and_execute_ && !table_flag_.is_check_no_exists_; }
|
||||
bool rollback_when_check_failed() const override { return table_flag_.is_check_and_execute_ && table_flag_.rollback_when_check_failed_; }
|
||||
uint64_t get_checksum();
|
||||
|
||||
TO_STRING_KV(K_(query),
|
||||
K_(mutations),
|
||||
K_(return_affected_entity),
|
||||
K_(flag),
|
||||
K_(is_check_and_execute),
|
||||
K_(is_check_no_exists),
|
||||
K_(rollback_when_check_failed));
|
||||
K_(table_flag_.is_check_and_execute),
|
||||
K_(table_flag_.is_check_no_exists),
|
||||
K_(table_flag_.rollback_when_check_failed));
|
||||
private:
|
||||
ObTableQuery query_;
|
||||
ObTableBatchOperation mutations_;
|
||||
@ -1251,8 +1251,14 @@ private:
|
||||
bool is_check_and_execute_ : 1;
|
||||
bool is_check_no_exists_ : 1;
|
||||
bool rollback_when_check_failed_ : 1;
|
||||
int64_t reserved : 61;
|
||||
};
|
||||
uint64_t reserved : 61; // 64 - 3
|
||||
} table_flag_;
|
||||
struct
|
||||
{
|
||||
uint64_t reversed_1 : 3;
|
||||
uint64_t is_user_specific_T_ : 1;
|
||||
uint64_t reserved : 60; // 64 - 4
|
||||
} hbase_flag_;
|
||||
};
|
||||
};
|
||||
|
||||
@ -1778,8 +1784,8 @@ public:
|
||||
deserialize_alloc_ = allocator;
|
||||
}
|
||||
|
||||
OB_INLINE bool is_check_no_exists() const { return is_check_no_exists_; }
|
||||
OB_INLINE bool rollback_when_check_failed() const { return rollback_when_check_failed_; }
|
||||
OB_INLINE bool is_check_no_exists() const { return table_flag_.is_check_no_exists_; }
|
||||
OB_INLINE bool rollback_when_check_failed() const { return table_flag_.rollback_when_check_failed_; }
|
||||
|
||||
OB_INLINE void set_dictionary(const ObIArray<ObString> *all_rowkey_names, const ObIArray<ObString> *all_properties_names) {
|
||||
all_rowkey_names_ = all_rowkey_names;
|
||||
@ -1798,7 +1804,7 @@ public:
|
||||
|
||||
TO_STRING_KV(K_(op_type),
|
||||
K_(flag),
|
||||
K_(is_check_no_exists),
|
||||
K_(table_flag_.is_check_no_exists),
|
||||
K_(op_query),
|
||||
K_(entities));
|
||||
private:
|
||||
@ -1808,10 +1814,17 @@ private:
|
||||
uint64_t flag_;
|
||||
struct
|
||||
{
|
||||
bool is_check_no_exists_ : 1;
|
||||
bool rollback_when_check_failed_ : 1;
|
||||
int64_t reserved : 62;
|
||||
};
|
||||
bool is_check_no_exists_ : 1;
|
||||
bool rollback_when_check_failed_ : 1;
|
||||
uint64_t reserved : 62; // 64 - 2
|
||||
} table_flag_;
|
||||
|
||||
struct
|
||||
{
|
||||
uint64_t reversed_1 : 2;
|
||||
uint64_t is_user_specific_T_ : 1;
|
||||
uint64_t reserved : 61; // 64 - 3
|
||||
} hbase_flag_;
|
||||
};
|
||||
// Note: Only the HBase checkAndMutate operation may have multiple entities,
|
||||
// In such cases, we decode the size first and prepare_allocate the entities at once.
|
||||
|
||||
@ -23,12 +23,12 @@ ObKVFeatureMode::ObKVFeatureMode(const uint8_t *values)
|
||||
value_ = 0;
|
||||
is_valid_ = false;
|
||||
} else {
|
||||
value_ = values[0];
|
||||
value_ = static_cast<uint16_t>(values[0]);
|
||||
is_valid_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ObKVFeatureMode::set_ttl_mode(uint8_t mode)
|
||||
void ObKVFeatureMode::set_ttl_mode(uint16_t mode)
|
||||
{
|
||||
is_valid_ = check_mode_valid(mode);
|
||||
if (is_valid_) {
|
||||
@ -36,7 +36,7 @@ void ObKVFeatureMode::set_ttl_mode(uint8_t mode)
|
||||
}
|
||||
}
|
||||
|
||||
void ObKVFeatureMode::set_rerouting_mode(uint8_t mode)
|
||||
void ObKVFeatureMode::set_rerouting_mode(uint16_t mode)
|
||||
{
|
||||
is_valid_ = check_mode_valid(mode);
|
||||
if (is_valid_) {
|
||||
@ -44,7 +44,7 @@ void ObKVFeatureMode::set_rerouting_mode(uint8_t mode)
|
||||
}
|
||||
}
|
||||
|
||||
void ObKVFeatureMode::set_hotkey_mode(uint8_t mode)
|
||||
void ObKVFeatureMode::set_hotkey_mode(uint16_t mode)
|
||||
{
|
||||
is_valid_ = check_mode_valid(mode);
|
||||
if (is_valid_) {
|
||||
@ -52,7 +52,7 @@ void ObKVFeatureMode::set_hotkey_mode(uint8_t mode)
|
||||
}
|
||||
}
|
||||
|
||||
void ObKVFeatureMode::set_value(uint8_t value)
|
||||
void ObKVFeatureMode::set_value(uint16_t value)
|
||||
{
|
||||
if ((value & 0b11) == 0b11 || ((value >> 2) & 0b11) == 0b11 || ((value >> 4) & 0b11) == 0b11) {
|
||||
is_valid_ = false;
|
||||
|
||||
@ -25,6 +25,7 @@ enum ObKVFeatureType {
|
||||
TTL,
|
||||
REROUTING,
|
||||
HOTKEY,
|
||||
DISTRIBUTED_EXECUTE,
|
||||
MAXTYPE
|
||||
};
|
||||
|
||||
@ -34,24 +35,25 @@ public:
|
||||
ObKVFeatureMode(): is_valid_(false), value_(0) {}
|
||||
ObKVFeatureMode(const uint8_t *values);
|
||||
bool is_valid() { return is_valid_; }
|
||||
bool check_mode_valid(uint8_t mode) { return mode > 2 ? false : true; }
|
||||
bool check_mode_valid(uint16_t mode) { return mode > 2 ? false : true; }
|
||||
bool is_ttl_enable();
|
||||
bool is_rerouting_enable();
|
||||
bool is_hotkey_enable();
|
||||
void set_ttl_mode(uint8_t mode);
|
||||
void set_rerouting_mode(uint8_t mode);
|
||||
void set_hotkey_mode(uint8_t mode);
|
||||
void set_value(uint8_t value);
|
||||
int8_t get_value() const { return value_; }
|
||||
void set_ttl_mode(uint16_t mode);
|
||||
void set_rerouting_mode(uint16_t mode);
|
||||
void set_hotkey_mode(uint16_t mode);
|
||||
void set_value(uint16_t value);
|
||||
uint16_t get_value() const { return value_; }
|
||||
private:
|
||||
bool is_valid_;
|
||||
union {
|
||||
uint8_t value_;
|
||||
uint16_t value_; //FARM COMPAT WHITELIST
|
||||
struct {
|
||||
uint8_t ttl_mode_ : 2;
|
||||
uint8_t rerouting_mode_ : 2;
|
||||
uint8_t hotkey_mode_ : 2;
|
||||
uint8_t reserver_mode_ :2;
|
||||
uint8_t distributed_execute_mode_ : 2;
|
||||
uint8_t reserver_mode_ :8;
|
||||
};
|
||||
};
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user