move logic_macro_id

This commit is contained in:
obdev
2022-11-28 01:49:29 +00:00
committed by ob-robot
parent 54b64a7263
commit 92c51091d7
41 changed files with 334 additions and 244 deletions

View File

@ -32,74 +32,6 @@
using namespace oceanbase;
using namespace oceanbase::common;
int64_t ObLogicMacroBlockId::hash() const
{
int64_t hash_val = 0;
hash_val = common::murmurhash(&data_seq_, sizeof(data_seq_), hash_val);
hash_val = common::murmurhash(&logic_version_, sizeof(logic_version_), hash_val);
hash_val = common::murmurhash(&tablet_id_, sizeof(tablet_id_), hash_val);
return hash_val;
}
bool ObLogicMacroBlockId::operator==(const ObLogicMacroBlockId &other) const
{
return data_seq_ == other.data_seq_
&& logic_version_ == other.logic_version_
&& tablet_id_ == other.tablet_id_;
}
bool ObLogicMacroBlockId::operator!=(const ObLogicMacroBlockId &other) const
{
return !(operator==(other));
}
bool ObLogicMacroBlockId::operator<(const ObLogicMacroBlockId &other) const
{
bool bool_ret = false;
if (tablet_id_ < other.tablet_id_) {
bool_ret = true;
} else if (tablet_id_ > other.tablet_id_) {
bool_ret= false;
} else if (logic_version_ < other.logic_version_) {
bool_ret = true;
} else if (logic_version_ > other.logic_version_) {
bool_ret = false;
} else if (data_seq_ < other.data_seq_) {
bool_ret = true;
} else if (data_seq_ > other.data_seq_) {
bool_ret = false;
}
return bool_ret;
}
bool ObLogicMacroBlockId::operator>(const ObLogicMacroBlockId &other) const
{
bool bool_ret = false;
if (tablet_id_ < other.tablet_id_) {
bool_ret = false;
} else if (tablet_id_ > other.tablet_id_) {
bool_ret= true;
} else if (logic_version_ < other.logic_version_) {
bool_ret = false;
} else if (logic_version_ > other.logic_version_) {
bool_ret = true;
} else if (data_seq_ < other.data_seq_) {
bool_ret = false;
} else if (data_seq_ > other.data_seq_) {
bool_ret = true;
}
return bool_ret;
}
void ObLogicMacroBlockId::reset() {
logic_version_ = 0;
data_seq_ = 0;
tablet_id_ = 0;
}
OB_SERIALIZE_MEMBER(ObLogicMacroBlockId, data_seq_, logic_version_, tablet_id_);
bool ObLobId::operator==(const ObLobId &other) const
{
return tablet_id_ == other.tablet_id_ && lob_id_ == other.lob_id_;
@ -331,7 +263,7 @@ DEF_TO_STRING(ObLobLocator)
const char *ObObj::MIN_OBJECT_VALUE_STR = "__OB__MIN__";
const char *ObObj::MAX_OBJECT_VALUE_STR = "__OB__MAX__";
const char *ObObj::NOP_VALUE_STR = "__OB__NOP__";
const char OB_JSON_NULL[2] = {'\0', '\0'}; // binary json null
const char OB_JSON_NULL[2] = {'\0', '\0'}; // binary json null
OB_SERIALIZE_MEMBER(ObDataType, meta_, accuracy_, is_zero_fill_);
OB_SERIALIZE_MEMBER(ObEnumSetInnerValue, numberic_value_, string_value_);
@ -428,7 +360,7 @@ bool ObObj::is_zero() const
break;
}
case ObIntervalYMType : {
ret = (0 == v_.nmonth_);
ret = (0 == v_.nmonth_);
break;
}
default: