feat: add WriteHint and PrimaryKeyEncoding to Mutation (#209)

* feat: add `write_hint` to `Mutation`

* feat: introduce `PrimaryKeyEncoding` and `WriteHint`
This commit is contained in:
Weny Xu
2025-01-22 12:00:46 +08:00
committed by GitHub
parent ec801a91aa
commit 6cee3db98a
5 changed files with 1725 additions and 69 deletions
+283 -15
View File
@@ -22,9 +22,23 @@ namespace _pbi = _pb::internal;
namespace greptime { namespace greptime {
namespace v1 { namespace v1 {
PROTOBUF_CONSTEXPR WriteHint::WriteHint(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.primary_key_encoding_)*/0
, /*decltype(_impl_._cached_size_)*/{}} {}
struct WriteHintDefaultTypeInternal {
PROTOBUF_CONSTEXPR WriteHintDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~WriteHintDefaultTypeInternal() {}
union {
WriteHint _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WriteHintDefaultTypeInternal _WriteHint_default_instance_;
PROTOBUF_CONSTEXPR Mutation::Mutation( PROTOBUF_CONSTEXPR Mutation::Mutation(
::_pbi::ConstantInitialized): _impl_{ ::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.rows_)*/nullptr /*decltype(_impl_.rows_)*/nullptr
, /*decltype(_impl_.write_hint_)*/nullptr
, /*decltype(_impl_.sequence_)*/uint64_t{0u} , /*decltype(_impl_.sequence_)*/uint64_t{0u}
, /*decltype(_impl_.op_type_)*/0 , /*decltype(_impl_.op_type_)*/0
, /*decltype(_impl_._cached_size_)*/{}} {} , /*decltype(_impl_._cached_size_)*/{}} {}
@@ -52,11 +66,18 @@ struct WalEntryDefaultTypeInternal {
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WalEntryDefaultTypeInternal _WalEntry_default_instance_; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WalEntryDefaultTypeInternal _WalEntry_default_instance_;
} // namespace v1 } // namespace v1
} // namespace greptime } // namespace greptime
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fwal_2eproto[2]; static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fwal_2eproto[3];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fwal_2eproto[1]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fwal_2eproto[2];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fwal_2eproto = nullptr; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fwal_2eproto = nullptr;
const uint32_t TableStruct_greptime_2fv1_2fwal_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { const uint32_t TableStruct_greptime_2fv1_2fwal_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::WriteHint, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::greptime::v1::WriteHint, _impl_.primary_key_encoding_),
~0u, // no _has_bits_ ~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::Mutation, _internal_metadata_), PROTOBUF_FIELD_OFFSET(::greptime::v1::Mutation, _internal_metadata_),
~0u, // no _extensions_ ~0u, // no _extensions_
@@ -66,6 +87,7 @@ const uint32_t TableStruct_greptime_2fv1_2fwal_2eproto::offsets[] PROTOBUF_SECTI
PROTOBUF_FIELD_OFFSET(::greptime::v1::Mutation, _impl_.op_type_), PROTOBUF_FIELD_OFFSET(::greptime::v1::Mutation, _impl_.op_type_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::Mutation, _impl_.sequence_), PROTOBUF_FIELD_OFFSET(::greptime::v1::Mutation, _impl_.sequence_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::Mutation, _impl_.rows_), PROTOBUF_FIELD_OFFSET(::greptime::v1::Mutation, _impl_.rows_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::Mutation, _impl_.write_hint_),
~0u, // no _has_bits_ ~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::WalEntry, _internal_metadata_), PROTOBUF_FIELD_OFFSET(::greptime::v1::WalEntry, _internal_metadata_),
~0u, // no _extensions_ ~0u, // no _extensions_
@@ -75,33 +97,39 @@ const uint32_t TableStruct_greptime_2fv1_2fwal_2eproto::offsets[] PROTOBUF_SECTI
PROTOBUF_FIELD_OFFSET(::greptime::v1::WalEntry, _impl_.mutations_), PROTOBUF_FIELD_OFFSET(::greptime::v1::WalEntry, _impl_.mutations_),
}; };
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::greptime::v1::Mutation)}, { 0, -1, -1, sizeof(::greptime::v1::WriteHint)},
{ 9, -1, -1, sizeof(::greptime::v1::WalEntry)}, { 7, -1, -1, sizeof(::greptime::v1::Mutation)},
{ 17, -1, -1, sizeof(::greptime::v1::WalEntry)},
}; };
static const ::_pb::Message* const file_default_instances[] = { static const ::_pb::Message* const file_default_instances[] = {
&::greptime::v1::_WriteHint_default_instance_._instance,
&::greptime::v1::_Mutation_default_instance_._instance, &::greptime::v1::_Mutation_default_instance_._instance,
&::greptime::v1::_WalEntry_default_instance_._instance, &::greptime::v1::_WalEntry_default_instance_._instance,
}; };
const char descriptor_table_protodef_greptime_2fv1_2fwal_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = const char descriptor_table_protodef_greptime_2fv1_2fwal_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\025greptime/v1/wal.proto\022\013greptime.v1\032\025gr" "\n\025greptime/v1/wal.proto\022\013greptime.v1\032\025gr"
"eptime/v1/row.proto\"c\n\010Mutation\022$\n\007op_ty" "eptime/v1/row.proto\"J\n\tWriteHint\022=\n\024prim"
"pe\030\001 \001(\0162\023.greptime.v1.OpType\022\020\n\010sequenc" "ary_key_encoding\030\001 \001(\0162\037.greptime.v1.Pri"
"e\030\002 \001(\004\022\037\n\004rows\030\003 \001(\0132\021.greptime.v1.Rows" "maryKeyEncoding\"\217\001\n\010Mutation\022$\n\007op_type\030"
"\"4\n\010WalEntry\022(\n\tmutations\030\001 \003(\0132\025.grepti" "\001 \001(\0162\023.greptime.v1.OpType\022\020\n\010sequence\030\002"
"me.v1.Mutation*\035\n\006OpType\022\n\n\006DELETE\020\000\022\007\n\003" " \001(\004\022\037\n\004rows\030\003 \001(\0132\021.greptime.v1.Rows\022*\n"
"PUT\020\001B7Z5github.com/GreptimeTeam/greptim" "\nwrite_hint\030\004 \001(\0132\026.greptime.v1.WriteHin"
"e-proto/go/greptime/v1b\006proto3" "t\"4\n\010WalEntry\022(\n\tmutations\030\001 \003(\0132\025.grept"
"ime.v1.Mutation*\035\n\006OpType\022\n\n\006DELETE\020\000\022\007\n"
"\003PUT\020\001*+\n\022PrimaryKeyEncoding\022\t\n\005DENSE\020\000\022"
"\n\n\006SPARSE\020\001B7Z5github.com/GreptimeTeam/g"
"reptime-proto/go/greptime/v1b\006proto3"
; ;
static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fwal_2eproto_deps[1] = { static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fwal_2eproto_deps[1] = {
&::descriptor_table_greptime_2fv1_2frow_2eproto, &::descriptor_table_greptime_2fv1_2frow_2eproto,
}; };
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fwal_2eproto_once; static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fwal_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fwal_2eproto = { const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fwal_2eproto = {
false, false, 310, descriptor_table_protodef_greptime_2fv1_2fwal_2eproto, false, false, 476, descriptor_table_protodef_greptime_2fv1_2fwal_2eproto,
"greptime/v1/wal.proto", "greptime/v1/wal.proto",
&descriptor_table_greptime_2fv1_2fwal_2eproto_once, descriptor_table_greptime_2fv1_2fwal_2eproto_deps, 1, 2, &descriptor_table_greptime_2fv1_2fwal_2eproto_once, descriptor_table_greptime_2fv1_2fwal_2eproto_deps, 1, 3,
schemas, file_default_instances, TableStruct_greptime_2fv1_2fwal_2eproto::offsets, schemas, file_default_instances, TableStruct_greptime_2fv1_2fwal_2eproto::offsets,
file_level_metadata_greptime_2fv1_2fwal_2eproto, file_level_enum_descriptors_greptime_2fv1_2fwal_2eproto, file_level_metadata_greptime_2fv1_2fwal_2eproto, file_level_enum_descriptors_greptime_2fv1_2fwal_2eproto,
file_level_service_descriptors_greptime_2fv1_2fwal_2eproto, file_level_service_descriptors_greptime_2fv1_2fwal_2eproto,
@@ -128,18 +156,218 @@ bool OpType_IsValid(int value) {
} }
} }
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PrimaryKeyEncoding_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_greptime_2fv1_2fwal_2eproto);
return file_level_enum_descriptors_greptime_2fv1_2fwal_2eproto[1];
}
bool PrimaryKeyEncoding_IsValid(int value) {
switch (value) {
case 0:
case 1:
return true;
default:
return false;
}
}
// ===================================================================
class WriteHint::_Internal {
public:
};
WriteHint::WriteHint(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:greptime.v1.WriteHint)
}
WriteHint::WriteHint(const WriteHint& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
WriteHint* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.primary_key_encoding_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_impl_.primary_key_encoding_ = from._impl_.primary_key_encoding_;
// @@protoc_insertion_point(copy_constructor:greptime.v1.WriteHint)
}
inline void WriteHint::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.primary_key_encoding_){0}
, /*decltype(_impl_._cached_size_)*/{}
};
}
WriteHint::~WriteHint() {
// @@protoc_insertion_point(destructor:greptime.v1.WriteHint)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
SharedDtor();
}
inline void WriteHint::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}
void WriteHint::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
void WriteHint::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.WriteHint)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.primary_key_encoding_ = 0;
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* WriteHint::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// .greptime.v1.PrimaryKeyEncoding primary_key_encoding = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
_internal_set_primary_key_encoding(static_cast<::greptime::v1::PrimaryKeyEncoding>(val));
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* WriteHint::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:greptime.v1.WriteHint)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// .greptime.v1.PrimaryKeyEncoding primary_key_encoding = 1;
if (this->_internal_primary_key_encoding() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteEnumToArray(
1, this->_internal_primary_key_encoding(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:greptime.v1.WriteHint)
return target;
}
size_t WriteHint::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.WriteHint)
size_t total_size = 0;
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .greptime.v1.PrimaryKeyEncoding primary_key_encoding = 1;
if (this->_internal_primary_key_encoding() != 0) {
total_size += 1 +
::_pbi::WireFormatLite::EnumSize(this->_internal_primary_key_encoding());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData WriteHint::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
WriteHint::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*WriteHint::GetClassData() const { return &_class_data_; }
void WriteHint::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
auto* const _this = static_cast<WriteHint*>(&to_msg);
auto& from = static_cast<const WriteHint&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.WriteHint)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_primary_key_encoding() != 0) {
_this->_internal_set_primary_key_encoding(from._internal_primary_key_encoding());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
void WriteHint::CopyFrom(const WriteHint& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.WriteHint)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool WriteHint::IsInitialized() const {
return true;
}
void WriteHint::InternalSwap(WriteHint* other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_.primary_key_encoding_, other->_impl_.primary_key_encoding_);
}
::PROTOBUF_NAMESPACE_ID::Metadata WriteHint::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2fwal_2eproto_getter, &descriptor_table_greptime_2fv1_2fwal_2eproto_once,
file_level_metadata_greptime_2fv1_2fwal_2eproto[0]);
}
// =================================================================== // ===================================================================
class Mutation::_Internal { class Mutation::_Internal {
public: public:
static const ::greptime::v1::Rows& rows(const Mutation* msg); static const ::greptime::v1::Rows& rows(const Mutation* msg);
static const ::greptime::v1::WriteHint& write_hint(const Mutation* msg);
}; };
const ::greptime::v1::Rows& const ::greptime::v1::Rows&
Mutation::_Internal::rows(const Mutation* msg) { Mutation::_Internal::rows(const Mutation* msg) {
return *msg->_impl_.rows_; return *msg->_impl_.rows_;
} }
const ::greptime::v1::WriteHint&
Mutation::_Internal::write_hint(const Mutation* msg) {
return *msg->_impl_.write_hint_;
}
void Mutation::clear_rows() { void Mutation::clear_rows() {
if (GetArenaForAllocation() == nullptr && _impl_.rows_ != nullptr) { if (GetArenaForAllocation() == nullptr && _impl_.rows_ != nullptr) {
delete _impl_.rows_; delete _impl_.rows_;
@@ -157,6 +385,7 @@ Mutation::Mutation(const Mutation& from)
Mutation* const _this = this; (void)_this; Mutation* const _this = this; (void)_this;
new (&_impl_) Impl_{ new (&_impl_) Impl_{
decltype(_impl_.rows_){nullptr} decltype(_impl_.rows_){nullptr}
, decltype(_impl_.write_hint_){nullptr}
, decltype(_impl_.sequence_){} , decltype(_impl_.sequence_){}
, decltype(_impl_.op_type_){} , decltype(_impl_.op_type_){}
, /*decltype(_impl_._cached_size_)*/{}}; , /*decltype(_impl_._cached_size_)*/{}};
@@ -165,6 +394,9 @@ Mutation::Mutation(const Mutation& from)
if (from._internal_has_rows()) { if (from._internal_has_rows()) {
_this->_impl_.rows_ = new ::greptime::v1::Rows(*from._impl_.rows_); _this->_impl_.rows_ = new ::greptime::v1::Rows(*from._impl_.rows_);
} }
if (from._internal_has_write_hint()) {
_this->_impl_.write_hint_ = new ::greptime::v1::WriteHint(*from._impl_.write_hint_);
}
::memcpy(&_impl_.sequence_, &from._impl_.sequence_, ::memcpy(&_impl_.sequence_, &from._impl_.sequence_,
static_cast<size_t>(reinterpret_cast<char*>(&_impl_.op_type_) - static_cast<size_t>(reinterpret_cast<char*>(&_impl_.op_type_) -
reinterpret_cast<char*>(&_impl_.sequence_)) + sizeof(_impl_.op_type_)); reinterpret_cast<char*>(&_impl_.sequence_)) + sizeof(_impl_.op_type_));
@@ -177,6 +409,7 @@ inline void Mutation::SharedCtor(
(void)is_message_owned; (void)is_message_owned;
new (&_impl_) Impl_{ new (&_impl_) Impl_{
decltype(_impl_.rows_){nullptr} decltype(_impl_.rows_){nullptr}
, decltype(_impl_.write_hint_){nullptr}
, decltype(_impl_.sequence_){uint64_t{0u}} , decltype(_impl_.sequence_){uint64_t{0u}}
, decltype(_impl_.op_type_){0} , decltype(_impl_.op_type_){0}
, /*decltype(_impl_._cached_size_)*/{} , /*decltype(_impl_._cached_size_)*/{}
@@ -195,6 +428,7 @@ Mutation::~Mutation() {
inline void Mutation::SharedDtor() { inline void Mutation::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
if (this != internal_default_instance()) delete _impl_.rows_; if (this != internal_default_instance()) delete _impl_.rows_;
if (this != internal_default_instance()) delete _impl_.write_hint_;
} }
void Mutation::SetCachedSize(int size) const { void Mutation::SetCachedSize(int size) const {
@@ -211,6 +445,10 @@ void Mutation::Clear() {
delete _impl_.rows_; delete _impl_.rows_;
} }
_impl_.rows_ = nullptr; _impl_.rows_ = nullptr;
if (GetArenaForAllocation() == nullptr && _impl_.write_hint_ != nullptr) {
delete _impl_.write_hint_;
}
_impl_.write_hint_ = nullptr;
::memset(&_impl_.sequence_, 0, static_cast<size_t>( ::memset(&_impl_.sequence_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&_impl_.op_type_) - reinterpret_cast<char*>(&_impl_.op_type_) -
reinterpret_cast<char*>(&_impl_.sequence_)) + sizeof(_impl_.op_type_)); reinterpret_cast<char*>(&_impl_.sequence_)) + sizeof(_impl_.op_type_));
@@ -248,6 +486,14 @@ const char* Mutation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx)
} else } else
goto handle_unusual; goto handle_unusual;
continue; continue;
// .greptime.v1.WriteHint write_hint = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
ptr = ctx->ParseMessage(_internal_mutable_write_hint(), ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
default: default:
goto handle_unusual; goto handle_unusual;
} // switch } // switch
@@ -297,6 +543,13 @@ uint8_t* Mutation::_InternalSerialize(
_Internal::rows(this).GetCachedSize(), target, stream); _Internal::rows(this).GetCachedSize(), target, stream);
} }
// .greptime.v1.WriteHint write_hint = 4;
if (this->_internal_has_write_hint()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(4, _Internal::write_hint(this),
_Internal::write_hint(this).GetCachedSize(), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
@@ -320,6 +573,13 @@ size_t Mutation::ByteSizeLong() const {
*_impl_.rows_); *_impl_.rows_);
} }
// .greptime.v1.WriteHint write_hint = 4;
if (this->_internal_has_write_hint()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*_impl_.write_hint_);
}
// uint64 sequence = 2; // uint64 sequence = 2;
if (this->_internal_sequence() != 0) { if (this->_internal_sequence() != 0) {
total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_sequence()); total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_sequence());
@@ -353,6 +613,10 @@ void Mutation::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTO
_this->_internal_mutable_rows()->::greptime::v1::Rows::MergeFrom( _this->_internal_mutable_rows()->::greptime::v1::Rows::MergeFrom(
from._internal_rows()); from._internal_rows());
} }
if (from._internal_has_write_hint()) {
_this->_internal_mutable_write_hint()->::greptime::v1::WriteHint::MergeFrom(
from._internal_write_hint());
}
if (from._internal_sequence() != 0) { if (from._internal_sequence() != 0) {
_this->_internal_set_sequence(from._internal_sequence()); _this->_internal_set_sequence(from._internal_sequence());
} }
@@ -387,7 +651,7 @@ void Mutation::InternalSwap(Mutation* other) {
::PROTOBUF_NAMESPACE_ID::Metadata Mutation::GetMetadata() const { ::PROTOBUF_NAMESPACE_ID::Metadata Mutation::GetMetadata() const {
return ::_pbi::AssignDescriptors( return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2fwal_2eproto_getter, &descriptor_table_greptime_2fv1_2fwal_2eproto_once, &descriptor_table_greptime_2fv1_2fwal_2eproto_getter, &descriptor_table_greptime_2fv1_2fwal_2eproto_once,
file_level_metadata_greptime_2fv1_2fwal_2eproto[0]); file_level_metadata_greptime_2fv1_2fwal_2eproto[1]);
} }
// =================================================================== // ===================================================================
@@ -572,13 +836,17 @@ void WalEntry::InternalSwap(WalEntry* other) {
::PROTOBUF_NAMESPACE_ID::Metadata WalEntry::GetMetadata() const { ::PROTOBUF_NAMESPACE_ID::Metadata WalEntry::GetMetadata() const {
return ::_pbi::AssignDescriptors( return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2fwal_2eproto_getter, &descriptor_table_greptime_2fv1_2fwal_2eproto_once, &descriptor_table_greptime_2fv1_2fwal_2eproto_getter, &descriptor_table_greptime_2fv1_2fwal_2eproto_once,
file_level_metadata_greptime_2fv1_2fwal_2eproto[1]); file_level_metadata_greptime_2fv1_2fwal_2eproto[2]);
} }
// @@protoc_insertion_point(namespace_scope) // @@protoc_insertion_point(namespace_scope)
} // namespace v1 } // namespace v1
} // namespace greptime } // namespace greptime
PROTOBUF_NAMESPACE_OPEN PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::greptime::v1::WriteHint*
Arena::CreateMaybeMessage< ::greptime::v1::WriteHint >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::WriteHint >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::Mutation* template<> PROTOBUF_NOINLINE ::greptime::v1::Mutation*
Arena::CreateMaybeMessage< ::greptime::v1::Mutation >(Arena* arena) { Arena::CreateMaybeMessage< ::greptime::v1::Mutation >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::Mutation >(arena); return Arena::CreateMessageInternal< ::greptime::v1::Mutation >(arena);
+320 -2
View File
@@ -54,11 +54,15 @@ extern MutationDefaultTypeInternal _Mutation_default_instance_;
class WalEntry; class WalEntry;
struct WalEntryDefaultTypeInternal; struct WalEntryDefaultTypeInternal;
extern WalEntryDefaultTypeInternal _WalEntry_default_instance_; extern WalEntryDefaultTypeInternal _WalEntry_default_instance_;
class WriteHint;
struct WriteHintDefaultTypeInternal;
extern WriteHintDefaultTypeInternal _WriteHint_default_instance_;
} // namespace v1 } // namespace v1
} // namespace greptime } // namespace greptime
PROTOBUF_NAMESPACE_OPEN PROTOBUF_NAMESPACE_OPEN
template<> ::greptime::v1::Mutation* Arena::CreateMaybeMessage<::greptime::v1::Mutation>(Arena*); template<> ::greptime::v1::Mutation* Arena::CreateMaybeMessage<::greptime::v1::Mutation>(Arena*);
template<> ::greptime::v1::WalEntry* Arena::CreateMaybeMessage<::greptime::v1::WalEntry>(Arena*); template<> ::greptime::v1::WalEntry* Arena::CreateMaybeMessage<::greptime::v1::WalEntry>(Arena*);
template<> ::greptime::v1::WriteHint* Arena::CreateMaybeMessage<::greptime::v1::WriteHint>(Arena*);
PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_CLOSE
namespace greptime { namespace greptime {
namespace v1 { namespace v1 {
@@ -88,8 +92,181 @@ inline bool OpType_Parse(
return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<OpType>( return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<OpType>(
OpType_descriptor(), name, value); OpType_descriptor(), name, value);
} }
enum PrimaryKeyEncoding : int {
DENSE = 0,
SPARSE = 1,
PrimaryKeyEncoding_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::min(),
PrimaryKeyEncoding_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::max()
};
bool PrimaryKeyEncoding_IsValid(int value);
constexpr PrimaryKeyEncoding PrimaryKeyEncoding_MIN = DENSE;
constexpr PrimaryKeyEncoding PrimaryKeyEncoding_MAX = SPARSE;
constexpr int PrimaryKeyEncoding_ARRAYSIZE = PrimaryKeyEncoding_MAX + 1;
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PrimaryKeyEncoding_descriptor();
template<typename T>
inline const std::string& PrimaryKeyEncoding_Name(T enum_t_value) {
static_assert(::std::is_same<T, PrimaryKeyEncoding>::value ||
::std::is_integral<T>::value,
"Incorrect type passed to function PrimaryKeyEncoding_Name.");
return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
PrimaryKeyEncoding_descriptor(), enum_t_value);
}
inline bool PrimaryKeyEncoding_Parse(
::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PrimaryKeyEncoding* value) {
return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<PrimaryKeyEncoding>(
PrimaryKeyEncoding_descriptor(), name, value);
}
// =================================================================== // ===================================================================
class WriteHint final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.WriteHint) */ {
public:
inline WriteHint() : WriteHint(nullptr) {}
~WriteHint() override;
explicit PROTOBUF_CONSTEXPR WriteHint(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
WriteHint(const WriteHint& from);
WriteHint(WriteHint&& from) noexcept
: WriteHint() {
*this = ::std::move(from);
}
inline WriteHint& operator=(const WriteHint& from) {
CopyFrom(from);
return *this;
}
inline WriteHint& operator=(WriteHint&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const WriteHint& default_instance() {
return *internal_default_instance();
}
static inline const WriteHint* internal_default_instance() {
return reinterpret_cast<const WriteHint*>(
&_WriteHint_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
friend void swap(WriteHint& a, WriteHint& b) {
a.Swap(&b);
}
inline void Swap(WriteHint* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(WriteHint* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
WriteHint* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<WriteHint>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
void CopyFrom(const WriteHint& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
void MergeFrom( const WriteHint& from) {
WriteHint::MergeImpl(*this, from);
}
private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(WriteHint* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "greptime.v1.WriteHint";
}
protected:
explicit WriteHint(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
public:
static const ClassData _class_data_;
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kPrimaryKeyEncodingFieldNumber = 1,
};
// .greptime.v1.PrimaryKeyEncoding primary_key_encoding = 1;
void clear_primary_key_encoding();
::greptime::v1::PrimaryKeyEncoding primary_key_encoding() const;
void set_primary_key_encoding(::greptime::v1::PrimaryKeyEncoding value);
private:
::greptime::v1::PrimaryKeyEncoding _internal_primary_key_encoding() const;
void _internal_set_primary_key_encoding(::greptime::v1::PrimaryKeyEncoding value);
public:
// @@protoc_insertion_point(class_scope:greptime.v1.WriteHint)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
int primary_key_encoding_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_greptime_2fv1_2fwal_2eproto;
};
// -------------------------------------------------------------------
class Mutation final : class Mutation final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.Mutation) */ { public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.Mutation) */ {
public: public:
@@ -138,7 +315,7 @@ class Mutation final :
&_Mutation_default_instance_); &_Mutation_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
0; 1;
friend void swap(Mutation& a, Mutation& b) { friend void swap(Mutation& a, Mutation& b) {
a.Swap(&b); a.Swap(&b);
@@ -212,6 +389,7 @@ class Mutation final :
enum : int { enum : int {
kRowsFieldNumber = 3, kRowsFieldNumber = 3,
kWriteHintFieldNumber = 4,
kSequenceFieldNumber = 2, kSequenceFieldNumber = 2,
kOpTypeFieldNumber = 1, kOpTypeFieldNumber = 1,
}; };
@@ -233,6 +411,24 @@ class Mutation final :
::greptime::v1::Rows* rows); ::greptime::v1::Rows* rows);
::greptime::v1::Rows* unsafe_arena_release_rows(); ::greptime::v1::Rows* unsafe_arena_release_rows();
// .greptime.v1.WriteHint write_hint = 4;
bool has_write_hint() const;
private:
bool _internal_has_write_hint() const;
public:
void clear_write_hint();
const ::greptime::v1::WriteHint& write_hint() const;
PROTOBUF_NODISCARD ::greptime::v1::WriteHint* release_write_hint();
::greptime::v1::WriteHint* mutable_write_hint();
void set_allocated_write_hint(::greptime::v1::WriteHint* write_hint);
private:
const ::greptime::v1::WriteHint& _internal_write_hint() const;
::greptime::v1::WriteHint* _internal_mutable_write_hint();
public:
void unsafe_arena_set_allocated_write_hint(
::greptime::v1::WriteHint* write_hint);
::greptime::v1::WriteHint* unsafe_arena_release_write_hint();
// uint64 sequence = 2; // uint64 sequence = 2;
void clear_sequence(); void clear_sequence();
uint64_t sequence() const; uint64_t sequence() const;
@@ -260,6 +456,7 @@ class Mutation final :
typedef void DestructorSkippable_; typedef void DestructorSkippable_;
struct Impl_ { struct Impl_ {
::greptime::v1::Rows* rows_; ::greptime::v1::Rows* rows_;
::greptime::v1::WriteHint* write_hint_;
uint64_t sequence_; uint64_t sequence_;
int op_type_; int op_type_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
@@ -317,7 +514,7 @@ class WalEntry final :
&_WalEntry_default_instance_); &_WalEntry_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
1; 2;
friend void swap(WalEntry& a, WalEntry& b) { friend void swap(WalEntry& a, WalEntry& b) {
a.Swap(&b); a.Swap(&b);
@@ -433,6 +630,30 @@ class WalEntry final :
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing" #pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__ #endif // __GNUC__
// WriteHint
// .greptime.v1.PrimaryKeyEncoding primary_key_encoding = 1;
inline void WriteHint::clear_primary_key_encoding() {
_impl_.primary_key_encoding_ = 0;
}
inline ::greptime::v1::PrimaryKeyEncoding WriteHint::_internal_primary_key_encoding() const {
return static_cast< ::greptime::v1::PrimaryKeyEncoding >(_impl_.primary_key_encoding_);
}
inline ::greptime::v1::PrimaryKeyEncoding WriteHint::primary_key_encoding() const {
// @@protoc_insertion_point(field_get:greptime.v1.WriteHint.primary_key_encoding)
return _internal_primary_key_encoding();
}
inline void WriteHint::_internal_set_primary_key_encoding(::greptime::v1::PrimaryKeyEncoding value) {
_impl_.primary_key_encoding_ = value;
}
inline void WriteHint::set_primary_key_encoding(::greptime::v1::PrimaryKeyEncoding value) {
_internal_set_primary_key_encoding(value);
// @@protoc_insertion_point(field_set:greptime.v1.WriteHint.primary_key_encoding)
}
// -------------------------------------------------------------------
// Mutation // Mutation
// .greptime.v1.OpType op_type = 1; // .greptime.v1.OpType op_type = 1;
@@ -560,6 +781,96 @@ inline void Mutation::set_allocated_rows(::greptime::v1::Rows* rows) {
// @@protoc_insertion_point(field_set_allocated:greptime.v1.Mutation.rows) // @@protoc_insertion_point(field_set_allocated:greptime.v1.Mutation.rows)
} }
// .greptime.v1.WriteHint write_hint = 4;
inline bool Mutation::_internal_has_write_hint() const {
return this != internal_default_instance() && _impl_.write_hint_ != nullptr;
}
inline bool Mutation::has_write_hint() const {
return _internal_has_write_hint();
}
inline void Mutation::clear_write_hint() {
if (GetArenaForAllocation() == nullptr && _impl_.write_hint_ != nullptr) {
delete _impl_.write_hint_;
}
_impl_.write_hint_ = nullptr;
}
inline const ::greptime::v1::WriteHint& Mutation::_internal_write_hint() const {
const ::greptime::v1::WriteHint* p = _impl_.write_hint_;
return p != nullptr ? *p : reinterpret_cast<const ::greptime::v1::WriteHint&>(
::greptime::v1::_WriteHint_default_instance_);
}
inline const ::greptime::v1::WriteHint& Mutation::write_hint() const {
// @@protoc_insertion_point(field_get:greptime.v1.Mutation.write_hint)
return _internal_write_hint();
}
inline void Mutation::unsafe_arena_set_allocated_write_hint(
::greptime::v1::WriteHint* write_hint) {
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.write_hint_);
}
_impl_.write_hint_ = write_hint;
if (write_hint) {
} else {
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:greptime.v1.Mutation.write_hint)
}
inline ::greptime::v1::WriteHint* Mutation::release_write_hint() {
::greptime::v1::WriteHint* temp = _impl_.write_hint_;
_impl_.write_hint_ = nullptr;
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
if (GetArenaForAllocation() == nullptr) { delete old; }
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp;
}
inline ::greptime::v1::WriteHint* Mutation::unsafe_arena_release_write_hint() {
// @@protoc_insertion_point(field_release:greptime.v1.Mutation.write_hint)
::greptime::v1::WriteHint* temp = _impl_.write_hint_;
_impl_.write_hint_ = nullptr;
return temp;
}
inline ::greptime::v1::WriteHint* Mutation::_internal_mutable_write_hint() {
if (_impl_.write_hint_ == nullptr) {
auto* p = CreateMaybeMessage<::greptime::v1::WriteHint>(GetArenaForAllocation());
_impl_.write_hint_ = p;
}
return _impl_.write_hint_;
}
inline ::greptime::v1::WriteHint* Mutation::mutable_write_hint() {
::greptime::v1::WriteHint* _msg = _internal_mutable_write_hint();
// @@protoc_insertion_point(field_mutable:greptime.v1.Mutation.write_hint)
return _msg;
}
inline void Mutation::set_allocated_write_hint(::greptime::v1::WriteHint* write_hint) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
delete _impl_.write_hint_;
}
if (write_hint) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(write_hint);
if (message_arena != submessage_arena) {
write_hint = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, write_hint, submessage_arena);
}
} else {
}
_impl_.write_hint_ = write_hint;
// @@protoc_insertion_point(field_set_allocated:greptime.v1.Mutation.write_hint)
}
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// WalEntry // WalEntry
@@ -609,6 +920,8 @@ WalEntry::mutations() const {
#endif // __GNUC__ #endif // __GNUC__
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope) // @@protoc_insertion_point(namespace_scope)
@@ -622,6 +935,11 @@ template <>
inline const EnumDescriptor* GetEnumDescriptor< ::greptime::v1::OpType>() { inline const EnumDescriptor* GetEnumDescriptor< ::greptime::v1::OpType>() {
return ::greptime::v1::OpType_descriptor(); return ::greptime::v1::OpType_descriptor();
} }
template <> struct is_proto_enum< ::greptime::v1::PrimaryKeyEncoding> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::greptime::v1::PrimaryKeyEncoding>() {
return ::greptime::v1::PrimaryKeyEncoding_descriptor();
}
PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_CLOSE
+173 -41
View File
@@ -83,6 +83,101 @@ func (OpType) EnumDescriptor() ([]byte, []int) {
return file_greptime_v1_wal_proto_rawDescGZIP(), []int{0} return file_greptime_v1_wal_proto_rawDescGZIP(), []int{0}
} }
// Encoding of primary key.
type PrimaryKeyEncoding int32
const (
PrimaryKeyEncoding_DENSE PrimaryKeyEncoding = 0
PrimaryKeyEncoding_SPARSE PrimaryKeyEncoding = 1
)
// Enum value maps for PrimaryKeyEncoding.
var (
PrimaryKeyEncoding_name = map[int32]string{
0: "DENSE",
1: "SPARSE",
}
PrimaryKeyEncoding_value = map[string]int32{
"DENSE": 0,
"SPARSE": 1,
}
)
func (x PrimaryKeyEncoding) Enum() *PrimaryKeyEncoding {
p := new(PrimaryKeyEncoding)
*p = x
return p
}
func (x PrimaryKeyEncoding) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PrimaryKeyEncoding) Descriptor() protoreflect.EnumDescriptor {
return file_greptime_v1_wal_proto_enumTypes[1].Descriptor()
}
func (PrimaryKeyEncoding) Type() protoreflect.EnumType {
return &file_greptime_v1_wal_proto_enumTypes[1]
}
func (x PrimaryKeyEncoding) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use PrimaryKeyEncoding.Descriptor instead.
func (PrimaryKeyEncoding) EnumDescriptor() ([]byte, []int) {
return file_greptime_v1_wal_proto_rawDescGZIP(), []int{1}
}
// Write hint of the mutation.
type WriteHint struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
PrimaryKeyEncoding PrimaryKeyEncoding `protobuf:"varint,1,opt,name=primary_key_encoding,json=primaryKeyEncoding,proto3,enum=greptime.v1.PrimaryKeyEncoding" json:"primary_key_encoding,omitempty"`
}
func (x *WriteHint) Reset() {
*x = WriteHint{}
if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_wal_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *WriteHint) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WriteHint) ProtoMessage() {}
func (x *WriteHint) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_wal_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use WriteHint.ProtoReflect.Descriptor instead.
func (*WriteHint) Descriptor() ([]byte, []int) {
return file_greptime_v1_wal_proto_rawDescGZIP(), []int{0}
}
func (x *WriteHint) GetPrimaryKeyEncoding() PrimaryKeyEncoding {
if x != nil {
return x.PrimaryKeyEncoding
}
return PrimaryKeyEncoding_DENSE
}
// Mutation contains updates to a set of rows. // Mutation contains updates to a set of rows.
type Mutation struct { type Mutation struct {
state protoimpl.MessageState state protoimpl.MessageState
@@ -95,12 +190,14 @@ type Mutation struct {
Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"`
// Row updates to write to the WAL. // Row updates to write to the WAL.
Rows *Rows `protobuf:"bytes,3,opt,name=rows,proto3" json:"rows,omitempty"` Rows *Rows `protobuf:"bytes,3,opt,name=rows,proto3" json:"rows,omitempty"`
// Write hint of the mutation.
WriteHint *WriteHint `protobuf:"bytes,4,opt,name=write_hint,json=writeHint,proto3" json:"write_hint,omitempty"`
} }
func (x *Mutation) Reset() { func (x *Mutation) Reset() {
*x = Mutation{} *x = Mutation{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_wal_proto_msgTypes[0] mi := &file_greptime_v1_wal_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -113,7 +210,7 @@ func (x *Mutation) String() string {
func (*Mutation) ProtoMessage() {} func (*Mutation) ProtoMessage() {}
func (x *Mutation) ProtoReflect() protoreflect.Message { func (x *Mutation) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_wal_proto_msgTypes[0] mi := &file_greptime_v1_wal_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -126,7 +223,7 @@ func (x *Mutation) ProtoReflect() protoreflect.Message {
// Deprecated: Use Mutation.ProtoReflect.Descriptor instead. // Deprecated: Use Mutation.ProtoReflect.Descriptor instead.
func (*Mutation) Descriptor() ([]byte, []int) { func (*Mutation) Descriptor() ([]byte, []int) {
return file_greptime_v1_wal_proto_rawDescGZIP(), []int{0} return file_greptime_v1_wal_proto_rawDescGZIP(), []int{1}
} }
func (x *Mutation) GetOpType() OpType { func (x *Mutation) GetOpType() OpType {
@@ -150,6 +247,13 @@ func (x *Mutation) GetRows() *Rows {
return nil return nil
} }
func (x *Mutation) GetWriteHint() *WriteHint {
if x != nil {
return x.WriteHint
}
return nil
}
// A WAL entry contains a list of mutations for a region to write. // A WAL entry contains a list of mutations for a region to write.
type WalEntry struct { type WalEntry struct {
state protoimpl.MessageState state protoimpl.MessageState
@@ -163,7 +267,7 @@ type WalEntry struct {
func (x *WalEntry) Reset() { func (x *WalEntry) Reset() {
*x = WalEntry{} *x = WalEntry{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_wal_proto_msgTypes[1] mi := &file_greptime_v1_wal_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -176,7 +280,7 @@ func (x *WalEntry) String() string {
func (*WalEntry) ProtoMessage() {} func (*WalEntry) ProtoMessage() {}
func (x *WalEntry) ProtoReflect() protoreflect.Message { func (x *WalEntry) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_wal_proto_msgTypes[1] mi := &file_greptime_v1_wal_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -189,7 +293,7 @@ func (x *WalEntry) ProtoReflect() protoreflect.Message {
// Deprecated: Use WalEntry.ProtoReflect.Descriptor instead. // Deprecated: Use WalEntry.ProtoReflect.Descriptor instead.
func (*WalEntry) Descriptor() ([]byte, []int) { func (*WalEntry) Descriptor() ([]byte, []int) {
return file_greptime_v1_wal_proto_rawDescGZIP(), []int{1} return file_greptime_v1_wal_proto_rawDescGZIP(), []int{2}
} }
func (x *WalEntry) GetMutations() []*Mutation { func (x *WalEntry) GetMutations() []*Mutation {
@@ -205,25 +309,37 @@ var file_greptime_v1_wal_proto_rawDesc = []byte{
0x0a, 0x15, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x0a, 0x15, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61,
0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d,
0x65, 0x2e, 0x76, 0x31, 0x1a, 0x15, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x15, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76,
0x31, 0x2f, 0x72, 0x6f, 0x77, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7b, 0x0a, 0x08, 0x4d, 0x31, 0x2f, 0x72, 0x6f, 0x77, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5e, 0x0a, 0x09, 0x57,
0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x07, 0x6f, 0x70, 0x5f, 0x74, 0x79, 0x72, 0x69, 0x74, 0x65, 0x48, 0x69, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x14, 0x70, 0x72, 0x69, 0x6d,
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67,
0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d,
0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x45,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x12, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79,
0x65, 0x12, 0x25, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x22, 0xb2, 0x01, 0x0a, 0x08,
0x11, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x07, 0x6f, 0x70, 0x5f, 0x74,
0x77, 0x73, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x3f, 0x0a, 0x08, 0x57, 0x61, 0x6c, 0x45, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x65, 0x70,
0x6e, 0x74, 0x72, 0x79, 0x12, 0x33, 0x0a, 0x09, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e,
0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e,
0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2a, 0x1d, 0x0a, 0x06, 0x4f, 0x70, 0x54, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x00, 0x12, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52,
0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x01, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x6f, 0x77, 0x73, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x12, 0x35, 0x0a, 0x0a, 0x77, 0x72, 0x69,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x54, 0x74, 0x65, 0x5f, 0x68, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e,
0x65, 0x61, 0x6d, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74,
0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x65, 0x48, 0x69, 0x6e, 0x74, 0x52, 0x09, 0x77, 0x72, 0x69, 0x74, 0x65, 0x48, 0x69, 0x6e, 0x74,
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22, 0x3f, 0x0a, 0x08, 0x57, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x33, 0x0a, 0x09,
0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x15, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x75,
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x2a, 0x1d, 0x0a, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x44,
0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x01,
0x2a, 0x2b, 0x0a, 0x12, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x45, 0x6e,
0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45, 0x4e, 0x53, 0x45, 0x10,
0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x50, 0x41, 0x52, 0x53, 0x45, 0x10, 0x01, 0x42, 0x37, 0x5a,
0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x65, 0x70,
0x74, 0x69, 0x6d, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d,
0x65, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74,
0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@@ -238,23 +354,27 @@ func file_greptime_v1_wal_proto_rawDescGZIP() []byte {
return file_greptime_v1_wal_proto_rawDescData return file_greptime_v1_wal_proto_rawDescData
} }
var file_greptime_v1_wal_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_greptime_v1_wal_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_greptime_v1_wal_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_greptime_v1_wal_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_greptime_v1_wal_proto_goTypes = []interface{}{ var file_greptime_v1_wal_proto_goTypes = []interface{}{
(OpType)(0), // 0: greptime.v1.OpType (OpType)(0), // 0: greptime.v1.OpType
(*Mutation)(nil), // 1: greptime.v1.Mutation (PrimaryKeyEncoding)(0), // 1: greptime.v1.PrimaryKeyEncoding
(*WalEntry)(nil), // 2: greptime.v1.WalEntry (*WriteHint)(nil), // 2: greptime.v1.WriteHint
(*Rows)(nil), // 3: greptime.v1.Rows (*Mutation)(nil), // 3: greptime.v1.Mutation
(*WalEntry)(nil), // 4: greptime.v1.WalEntry
(*Rows)(nil), // 5: greptime.v1.Rows
} }
var file_greptime_v1_wal_proto_depIdxs = []int32{ var file_greptime_v1_wal_proto_depIdxs = []int32{
0, // 0: greptime.v1.Mutation.op_type:type_name -> greptime.v1.OpType 1, // 0: greptime.v1.WriteHint.primary_key_encoding:type_name -> greptime.v1.PrimaryKeyEncoding
3, // 1: greptime.v1.Mutation.rows:type_name -> greptime.v1.Rows 0, // 1: greptime.v1.Mutation.op_type:type_name -> greptime.v1.OpType
1, // 2: greptime.v1.WalEntry.mutations:type_name -> greptime.v1.Mutation 5, // 2: greptime.v1.Mutation.rows:type_name -> greptime.v1.Rows
3, // [3:3] is the sub-list for method output_type 2, // 3: greptime.v1.Mutation.write_hint:type_name -> greptime.v1.WriteHint
3, // [3:3] is the sub-list for method input_type 3, // 4: greptime.v1.WalEntry.mutations:type_name -> greptime.v1.Mutation
3, // [3:3] is the sub-list for extension type_name 5, // [5:5] is the sub-list for method output_type
3, // [3:3] is the sub-list for extension extendee 5, // [5:5] is the sub-list for method input_type
0, // [0:3] is the sub-list for field type_name 5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
} }
func init() { file_greptime_v1_wal_proto_init() } func init() { file_greptime_v1_wal_proto_init() }
@@ -265,7 +385,7 @@ func file_greptime_v1_wal_proto_init() {
file_greptime_v1_row_proto_init() file_greptime_v1_row_proto_init()
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_greptime_v1_wal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_greptime_v1_wal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Mutation); i { switch v := v.(*WriteHint); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@@ -277,6 +397,18 @@ func file_greptime_v1_wal_proto_init() {
} }
} }
file_greptime_v1_wal_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_greptime_v1_wal_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Mutation); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_greptime_v1_wal_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WalEntry); i { switch v := v.(*WalEntry); i {
case 0: case 0:
return &v.state return &v.state
@@ -294,8 +426,8 @@ func file_greptime_v1_wal_proto_init() {
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_greptime_v1_wal_proto_rawDesc, RawDescriptor: file_greptime_v1_wal_proto_rawDesc,
NumEnums: 1, NumEnums: 2,
NumMessages: 2, NumMessages: 3,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },
File diff suppressed because it is too large Load Diff
+13
View File
@@ -28,6 +28,17 @@ enum OpType {
PUT = 1; PUT = 1;
} }
// Encoding of primary key.
enum PrimaryKeyEncoding {
DENSE = 0;
SPARSE = 1;
}
// Write hint of the mutation.
message WriteHint {
PrimaryKeyEncoding primary_key_encoding = 1;
}
// Mutation contains updates to a set of rows. // Mutation contains updates to a set of rows.
message Mutation { message Mutation {
// Type of this mutation. // Type of this mutation.
@@ -36,6 +47,8 @@ message Mutation {
uint64 sequence = 2; uint64 sequence = 2;
// Row updates to write to the WAL. // Row updates to write to the WAL.
Rows rows = 3; Rows rows = 3;
// Write hint of the mutation.
WriteHint write_hint = 4;
} }
// A WAL entry contains a list of mutations for a region to write. // A WAL entry contains a list of mutations for a region to write.