diff --git a/c++/greptime/v1/wal.pb.cc b/c++/greptime/v1/wal.pb.cc index 2a97cffe..ada312e4 100644 --- a/c++/greptime/v1/wal.pb.cc +++ b/c++/greptime/v1/wal.pb.cc @@ -22,9 +22,23 @@ namespace _pbi = _pb::internal; namespace greptime { namespace v1 { +PROTOBUF_CONSTEXPR ManifestNotification::ManifestNotification( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.version_)*/uint64_t{0u} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct ManifestNotificationDefaultTypeInternal { + PROTOBUF_CONSTEXPR ManifestNotificationDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ManifestNotificationDefaultTypeInternal() {} + union { + ManifestNotification _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ManifestNotificationDefaultTypeInternal _ManifestNotification_default_instance_; PROTOBUF_CONSTEXPR Mutation::Mutation( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.rows_)*/nullptr + , /*decltype(_impl_.manifest_notification_)*/nullptr , /*decltype(_impl_.sequence_)*/uint64_t{0u} , /*decltype(_impl_.op_type_)*/0 , /*decltype(_impl_._cached_size_)*/{}} {} @@ -52,11 +66,18 @@ struct WalEntryDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WalEntryDefaultTypeInternal _WalEntry_default_instance_; } // namespace v1 } // 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 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) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::greptime::v1::ManifestNotification, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::greptime::v1::ManifestNotification, _impl_.version_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::Mutation, _internal_metadata_), ~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_.sequence_), PROTOBUF_FIELD_OFFSET(::greptime::v1::Mutation, _impl_.rows_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::Mutation, _impl_.manifest_notification_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::WalEntry, _internal_metadata_), ~0u, // no _extensions_ @@ -75,23 +97,28 @@ const uint32_t TableStruct_greptime_2fv1_2fwal_2eproto::offsets[] PROTOBUF_SECTI PROTOBUF_FIELD_OFFSET(::greptime::v1::WalEntry, _impl_.mutations_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(::greptime::v1::Mutation)}, - { 9, -1, -1, sizeof(::greptime::v1::WalEntry)}, + { 0, -1, -1, sizeof(::greptime::v1::ManifestNotification)}, + { 7, -1, -1, sizeof(::greptime::v1::Mutation)}, + { 17, -1, -1, sizeof(::greptime::v1::WalEntry)}, }; static const ::_pb::Message* const file_default_instances[] = { + &::greptime::v1::_ManifestNotification_default_instance_._instance, &::greptime::v1::_Mutation_default_instance_._instance, &::greptime::v1::_WalEntry_default_instance_._instance, }; const char descriptor_table_protodef_greptime_2fv1_2fwal_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = "\n\025greptime/v1/wal.proto\022\013greptime.v1\032\025gr" - "eptime/v1/row.proto\"c\n\010Mutation\022$\n\007op_ty" - "pe\030\001 \001(\0162\023.greptime.v1.OpType\022\020\n\010sequenc" - "e\030\002 \001(\004\022\037\n\004rows\030\003 \001(\0132\021.greptime.v1.Rows" - "\"4\n\010WalEntry\022(\n\tmutations\030\001 \003(\0132\025.grepti" - "me.v1.Mutation*\035\n\006OpType\022\n\n\006DELETE\020\000\022\007\n\003" - "PUT\020\001B7Z5github.com/GreptimeTeam/greptim" + "eptime/v1/row.proto\"\'\n\024ManifestNotificat" + "ion\022\017\n\007version\030\001 \001(\004\"\245\001\n\010Mutation\022$\n\007op_" + "type\030\001 \001(\0162\023.greptime.v1.OpType\022\020\n\010seque" + "nce\030\002 \001(\004\022\037\n\004rows\030\003 \001(\0132\021.greptime.v1.Ro" + "ws\022@\n\025manifest_notification\030\004 \001(\0132!.grep" + "time.v1.ManifestNotification\"4\n\010WalEntry" + "\022(\n\tmutations\030\001 \003(\0132\025.greptime.v1.Mutati" + "on*)\n\006OpType\022\n\n\006DELETE\020\000\022\007\n\003PUT\020\001\022\n\n\006NOT" + "IFY\020\002B7Z5github.com/GreptimeTeam/greptim" "e-proto/go/greptime/v1b\006proto3" ; static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fwal_2eproto_deps[1] = { @@ -99,9 +126,9 @@ static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fwal }; static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fwal_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fwal_2eproto = { - false, false, 310, descriptor_table_protodef_greptime_2fv1_2fwal_2eproto, + false, false, 430, descriptor_table_protodef_greptime_2fv1_2fwal_2eproto, "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, file_level_metadata_greptime_2fv1_2fwal_2eproto, file_level_enum_descriptors_greptime_2fv1_2fwal_2eproto, file_level_service_descriptors_greptime_2fv1_2fwal_2eproto, @@ -122,6 +149,7 @@ bool OpType_IsValid(int value) { switch (value) { case 0: case 1: + case 2: return true; default: return false; @@ -129,17 +157,200 @@ bool OpType_IsValid(int value) { } +// =================================================================== + +class ManifestNotification::_Internal { + public: +}; + +ManifestNotification::ManifestNotification(::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.ManifestNotification) +} +ManifestNotification::ManifestNotification(const ManifestNotification& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + ManifestNotification* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.version_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.version_ = from._impl_.version_; + // @@protoc_insertion_point(copy_constructor:greptime.v1.ManifestNotification) +} + +inline void ManifestNotification::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.version_){uint64_t{0u}} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +ManifestNotification::~ManifestNotification() { + // @@protoc_insertion_point(destructor:greptime.v1.ManifestNotification) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void ManifestNotification::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void ManifestNotification::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void ManifestNotification::Clear() { +// @@protoc_insertion_point(message_clear_start:greptime.v1.ManifestNotification) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.version_ = uint64_t{0u}; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* ManifestNotification::_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) { + // uint64 version = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } 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* ManifestNotification::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.ManifestNotification) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 version = 1; + if (this->_internal_version() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_version(), 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.ManifestNotification) + return target; +} + +size_t ManifestNotification::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:greptime.v1.ManifestNotification) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // uint64 version = 1; + if (this->_internal_version() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_version()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ManifestNotification::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + ManifestNotification::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ManifestNotification::GetClassData() const { return &_class_data_; } + + +void ManifestNotification::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.ManifestNotification) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_version() != 0) { + _this->_internal_set_version(from._internal_version()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void ManifestNotification::CopyFrom(const ManifestNotification& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.ManifestNotification) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ManifestNotification::IsInitialized() const { + return true; +} + +void ManifestNotification::InternalSwap(ManifestNotification* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.version_, other->_impl_.version_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata ManifestNotification::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 { public: static const ::greptime::v1::Rows& rows(const Mutation* msg); + static const ::greptime::v1::ManifestNotification& manifest_notification(const Mutation* msg); }; const ::greptime::v1::Rows& Mutation::_Internal::rows(const Mutation* msg) { return *msg->_impl_.rows_; } +const ::greptime::v1::ManifestNotification& +Mutation::_Internal::manifest_notification(const Mutation* msg) { + return *msg->_impl_.manifest_notification_; +} void Mutation::clear_rows() { if (GetArenaForAllocation() == nullptr && _impl_.rows_ != nullptr) { delete _impl_.rows_; @@ -157,6 +368,7 @@ Mutation::Mutation(const Mutation& from) Mutation* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.rows_){nullptr} + , decltype(_impl_.manifest_notification_){nullptr} , decltype(_impl_.sequence_){} , decltype(_impl_.op_type_){} , /*decltype(_impl_._cached_size_)*/{}}; @@ -165,6 +377,9 @@ Mutation::Mutation(const Mutation& from) if (from._internal_has_rows()) { _this->_impl_.rows_ = new ::greptime::v1::Rows(*from._impl_.rows_); } + if (from._internal_has_manifest_notification()) { + _this->_impl_.manifest_notification_ = new ::greptime::v1::ManifestNotification(*from._impl_.manifest_notification_); + } ::memcpy(&_impl_.sequence_, &from._impl_.sequence_, static_cast(reinterpret_cast(&_impl_.op_type_) - reinterpret_cast(&_impl_.sequence_)) + sizeof(_impl_.op_type_)); @@ -177,6 +392,7 @@ inline void Mutation::SharedCtor( (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_.rows_){nullptr} + , decltype(_impl_.manifest_notification_){nullptr} , decltype(_impl_.sequence_){uint64_t{0u}} , decltype(_impl_.op_type_){0} , /*decltype(_impl_._cached_size_)*/{} @@ -195,6 +411,7 @@ Mutation::~Mutation() { inline void Mutation::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); if (this != internal_default_instance()) delete _impl_.rows_; + if (this != internal_default_instance()) delete _impl_.manifest_notification_; } void Mutation::SetCachedSize(int size) const { @@ -211,6 +428,10 @@ void Mutation::Clear() { delete _impl_.rows_; } _impl_.rows_ = nullptr; + if (GetArenaForAllocation() == nullptr && _impl_.manifest_notification_ != nullptr) { + delete _impl_.manifest_notification_; + } + _impl_.manifest_notification_ = nullptr; ::memset(&_impl_.sequence_, 0, static_cast( reinterpret_cast(&_impl_.op_type_) - reinterpret_cast(&_impl_.sequence_)) + sizeof(_impl_.op_type_)); @@ -248,6 +469,14 @@ const char* Mutation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } else goto handle_unusual; continue; + // .greptime.v1.ManifestNotification manifest_notification = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr = ctx->ParseMessage(_internal_mutable_manifest_notification(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -297,6 +526,13 @@ uint8_t* Mutation::_InternalSerialize( _Internal::rows(this).GetCachedSize(), target, stream); } + // .greptime.v1.ManifestNotification manifest_notification = 4; + if (this->_internal_has_manifest_notification()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::manifest_notification(this), + _Internal::manifest_notification(this).GetCachedSize(), target, stream); + } + 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); @@ -320,6 +556,13 @@ size_t Mutation::ByteSizeLong() const { *_impl_.rows_); } + // .greptime.v1.ManifestNotification manifest_notification = 4; + if (this->_internal_has_manifest_notification()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.manifest_notification_); + } + // uint64 sequence = 2; if (this->_internal_sequence() != 0) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_sequence()); @@ -353,6 +596,10 @@ void Mutation::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTO _this->_internal_mutable_rows()->::greptime::v1::Rows::MergeFrom( from._internal_rows()); } + if (from._internal_has_manifest_notification()) { + _this->_internal_mutable_manifest_notification()->::greptime::v1::ManifestNotification::MergeFrom( + from._internal_manifest_notification()); + } if (from._internal_sequence() != 0) { _this->_internal_set_sequence(from._internal_sequence()); } @@ -387,7 +634,7 @@ void Mutation::InternalSwap(Mutation* other) { ::PROTOBUF_NAMESPACE_ID::Metadata Mutation::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]); + file_level_metadata_greptime_2fv1_2fwal_2eproto[1]); } // =================================================================== @@ -572,13 +819,17 @@ void WalEntry::InternalSwap(WalEntry* other) { ::PROTOBUF_NAMESPACE_ID::Metadata WalEntry::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[1]); + file_level_metadata_greptime_2fv1_2fwal_2eproto[2]); } // @@protoc_insertion_point(namespace_scope) } // namespace v1 } // namespace greptime PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::greptime::v1::ManifestNotification* +Arena::CreateMaybeMessage< ::greptime::v1::ManifestNotification >(Arena* arena) { + return Arena::CreateMessageInternal< ::greptime::v1::ManifestNotification >(arena); +} template<> PROTOBUF_NOINLINE ::greptime::v1::Mutation* Arena::CreateMaybeMessage< ::greptime::v1::Mutation >(Arena* arena) { return Arena::CreateMessageInternal< ::greptime::v1::Mutation >(arena); diff --git a/c++/greptime/v1/wal.pb.h b/c++/greptime/v1/wal.pb.h index 302a0859..f1592c8a 100644 --- a/c++/greptime/v1/wal.pb.h +++ b/c++/greptime/v1/wal.pb.h @@ -48,6 +48,9 @@ struct TableStruct_greptime_2fv1_2fwal_2eproto { extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_greptime_2fv1_2fwal_2eproto; namespace greptime { namespace v1 { +class ManifestNotification; +struct ManifestNotificationDefaultTypeInternal; +extern ManifestNotificationDefaultTypeInternal _ManifestNotification_default_instance_; class Mutation; struct MutationDefaultTypeInternal; extern MutationDefaultTypeInternal _Mutation_default_instance_; @@ -57,6 +60,7 @@ extern WalEntryDefaultTypeInternal _WalEntry_default_instance_; } // namespace v1 } // namespace greptime PROTOBUF_NAMESPACE_OPEN +template<> ::greptime::v1::ManifestNotification* Arena::CreateMaybeMessage<::greptime::v1::ManifestNotification>(Arena*); template<> ::greptime::v1::Mutation* Arena::CreateMaybeMessage<::greptime::v1::Mutation>(Arena*); template<> ::greptime::v1::WalEntry* Arena::CreateMaybeMessage<::greptime::v1::WalEntry>(Arena*); PROTOBUF_NAMESPACE_CLOSE @@ -66,12 +70,13 @@ namespace v1 { enum OpType : int { DELETE = 0, PUT = 1, + NOTIFY = 2, OpType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), OpType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool OpType_IsValid(int value); constexpr OpType OpType_MIN = DELETE; -constexpr OpType OpType_MAX = PUT; +constexpr OpType OpType_MAX = NOTIFY; constexpr int OpType_ARRAYSIZE = OpType_MAX + 1; const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* OpType_descriptor(); @@ -90,6 +95,154 @@ inline bool OpType_Parse( } // =================================================================== +class ManifestNotification final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.ManifestNotification) */ { + public: + inline ManifestNotification() : ManifestNotification(nullptr) {} + ~ManifestNotification() override; + explicit PROTOBUF_CONSTEXPR ManifestNotification(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + ManifestNotification(const ManifestNotification& from); + ManifestNotification(ManifestNotification&& from) noexcept + : ManifestNotification() { + *this = ::std::move(from); + } + + inline ManifestNotification& operator=(const ManifestNotification& from) { + CopyFrom(from); + return *this; + } + inline ManifestNotification& operator=(ManifestNotification&& 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 ManifestNotification& default_instance() { + return *internal_default_instance(); + } + static inline const ManifestNotification* internal_default_instance() { + return reinterpret_cast( + &_ManifestNotification_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(ManifestNotification& a, ManifestNotification& b) { + a.Swap(&b); + } + inline void Swap(ManifestNotification* 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(ManifestNotification* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ManifestNotification* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ManifestNotification& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const ManifestNotification& from) { + ManifestNotification::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(ManifestNotification* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "greptime.v1.ManifestNotification"; + } + protected: + explicit ManifestNotification(::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 { + kVersionFieldNumber = 1, + }; + // uint64 version = 1; + void clear_version(); + uint64_t version() const; + void set_version(uint64_t value); + private: + uint64_t _internal_version() const; + void _internal_set_version(uint64_t value); + public: + + // @@protoc_insertion_point(class_scope:greptime.v1.ManifestNotification) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + uint64_t version_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_greptime_2fv1_2fwal_2eproto; +}; +// ------------------------------------------------------------------- + class Mutation final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.Mutation) */ { public: @@ -138,7 +291,7 @@ class Mutation final : &_Mutation_default_instance_); } static constexpr int kIndexInFileMessages = - 0; + 1; friend void swap(Mutation& a, Mutation& b) { a.Swap(&b); @@ -212,6 +365,7 @@ class Mutation final : enum : int { kRowsFieldNumber = 3, + kManifestNotificationFieldNumber = 4, kSequenceFieldNumber = 2, kOpTypeFieldNumber = 1, }; @@ -233,6 +387,24 @@ class Mutation final : ::greptime::v1::Rows* rows); ::greptime::v1::Rows* unsafe_arena_release_rows(); + // .greptime.v1.ManifestNotification manifest_notification = 4; + bool has_manifest_notification() const; + private: + bool _internal_has_manifest_notification() const; + public: + void clear_manifest_notification(); + const ::greptime::v1::ManifestNotification& manifest_notification() const; + PROTOBUF_NODISCARD ::greptime::v1::ManifestNotification* release_manifest_notification(); + ::greptime::v1::ManifestNotification* mutable_manifest_notification(); + void set_allocated_manifest_notification(::greptime::v1::ManifestNotification* manifest_notification); + private: + const ::greptime::v1::ManifestNotification& _internal_manifest_notification() const; + ::greptime::v1::ManifestNotification* _internal_mutable_manifest_notification(); + public: + void unsafe_arena_set_allocated_manifest_notification( + ::greptime::v1::ManifestNotification* manifest_notification); + ::greptime::v1::ManifestNotification* unsafe_arena_release_manifest_notification(); + // uint64 sequence = 2; void clear_sequence(); uint64_t sequence() const; @@ -260,6 +432,7 @@ class Mutation final : typedef void DestructorSkippable_; struct Impl_ { ::greptime::v1::Rows* rows_; + ::greptime::v1::ManifestNotification* manifest_notification_; uint64_t sequence_; int op_type_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; @@ -317,7 +490,7 @@ class WalEntry final : &_WalEntry_default_instance_); } static constexpr int kIndexInFileMessages = - 1; + 2; friend void swap(WalEntry& a, WalEntry& b) { a.Swap(&b); @@ -433,6 +606,30 @@ class WalEntry final : #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ +// ManifestNotification + +// uint64 version = 1; +inline void ManifestNotification::clear_version() { + _impl_.version_ = uint64_t{0u}; +} +inline uint64_t ManifestNotification::_internal_version() const { + return _impl_.version_; +} +inline uint64_t ManifestNotification::version() const { + // @@protoc_insertion_point(field_get:greptime.v1.ManifestNotification.version) + return _internal_version(); +} +inline void ManifestNotification::_internal_set_version(uint64_t value) { + + _impl_.version_ = value; +} +inline void ManifestNotification::set_version(uint64_t value) { + _internal_set_version(value); + // @@protoc_insertion_point(field_set:greptime.v1.ManifestNotification.version) +} + +// ------------------------------------------------------------------- + // Mutation // .greptime.v1.OpType op_type = 1; @@ -560,6 +757,96 @@ inline void Mutation::set_allocated_rows(::greptime::v1::Rows* rows) { // @@protoc_insertion_point(field_set_allocated:greptime.v1.Mutation.rows) } +// .greptime.v1.ManifestNotification manifest_notification = 4; +inline bool Mutation::_internal_has_manifest_notification() const { + return this != internal_default_instance() && _impl_.manifest_notification_ != nullptr; +} +inline bool Mutation::has_manifest_notification() const { + return _internal_has_manifest_notification(); +} +inline void Mutation::clear_manifest_notification() { + if (GetArenaForAllocation() == nullptr && _impl_.manifest_notification_ != nullptr) { + delete _impl_.manifest_notification_; + } + _impl_.manifest_notification_ = nullptr; +} +inline const ::greptime::v1::ManifestNotification& Mutation::_internal_manifest_notification() const { + const ::greptime::v1::ManifestNotification* p = _impl_.manifest_notification_; + return p != nullptr ? *p : reinterpret_cast( + ::greptime::v1::_ManifestNotification_default_instance_); +} +inline const ::greptime::v1::ManifestNotification& Mutation::manifest_notification() const { + // @@protoc_insertion_point(field_get:greptime.v1.Mutation.manifest_notification) + return _internal_manifest_notification(); +} +inline void Mutation::unsafe_arena_set_allocated_manifest_notification( + ::greptime::v1::ManifestNotification* manifest_notification) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.manifest_notification_); + } + _impl_.manifest_notification_ = manifest_notification; + if (manifest_notification) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:greptime.v1.Mutation.manifest_notification) +} +inline ::greptime::v1::ManifestNotification* Mutation::release_manifest_notification() { + + ::greptime::v1::ManifestNotification* temp = _impl_.manifest_notification_; + _impl_.manifest_notification_ = 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::ManifestNotification* Mutation::unsafe_arena_release_manifest_notification() { + // @@protoc_insertion_point(field_release:greptime.v1.Mutation.manifest_notification) + + ::greptime::v1::ManifestNotification* temp = _impl_.manifest_notification_; + _impl_.manifest_notification_ = nullptr; + return temp; +} +inline ::greptime::v1::ManifestNotification* Mutation::_internal_mutable_manifest_notification() { + + if (_impl_.manifest_notification_ == nullptr) { + auto* p = CreateMaybeMessage<::greptime::v1::ManifestNotification>(GetArenaForAllocation()); + _impl_.manifest_notification_ = p; + } + return _impl_.manifest_notification_; +} +inline ::greptime::v1::ManifestNotification* Mutation::mutable_manifest_notification() { + ::greptime::v1::ManifestNotification* _msg = _internal_mutable_manifest_notification(); + // @@protoc_insertion_point(field_mutable:greptime.v1.Mutation.manifest_notification) + return _msg; +} +inline void Mutation::set_allocated_manifest_notification(::greptime::v1::ManifestNotification* manifest_notification) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.manifest_notification_; + } + if (manifest_notification) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(manifest_notification); + if (message_arena != submessage_arena) { + manifest_notification = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, manifest_notification, submessage_arena); + } + + } else { + + } + _impl_.manifest_notification_ = manifest_notification; + // @@protoc_insertion_point(field_set_allocated:greptime.v1.Mutation.manifest_notification) +} + // ------------------------------------------------------------------- // WalEntry @@ -609,6 +896,8 @@ WalEntry::mutations() const { #endif // __GNUC__ // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/go/greptime/v1/wal.pb.go b/go/greptime/v1/wal.pb.go index 4243c8bb..de3a8184 100644 --- a/go/greptime/v1/wal.pb.go +++ b/go/greptime/v1/wal.pb.go @@ -42,6 +42,8 @@ const ( OpType_DELETE OpType = 0 // Put rows. OpType_PUT OpType = 1 + // Notify manifest changes. + OpType_NOTIFY OpType = 2 ) // Enum value maps for OpType. @@ -49,10 +51,12 @@ var ( OpType_name = map[int32]string{ 0: "DELETE", 1: "PUT", + 2: "NOTIFY", } OpType_value = map[string]int32{ "DELETE": 0, "PUT": 1, + "NOTIFY": 2, } ) @@ -83,6 +87,54 @@ func (OpType) EnumDescriptor() ([]byte, []int) { return file_greptime_v1_wal_proto_rawDescGZIP(), []int{0} } +// The manfeist notification content. +type ManifestNotification struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *ManifestNotification) Reset() { + *x = ManifestNotification{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_wal_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ManifestNotification) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ManifestNotification) ProtoMessage() {} + +func (x *ManifestNotification) 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 ManifestNotification.ProtoReflect.Descriptor instead. +func (*ManifestNotification) Descriptor() ([]byte, []int) { + return file_greptime_v1_wal_proto_rawDescGZIP(), []int{0} +} + +func (x *ManifestNotification) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + // Mutation contains updates to a set of rows. type Mutation struct { state protoimpl.MessageState @@ -95,12 +147,14 @@ type Mutation struct { Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` // Row updates to write to the WAL. Rows *Rows `protobuf:"bytes,3,opt,name=rows,proto3" json:"rows,omitempty"` + // The manifest change notification + ManifestNotification *ManifestNotification `protobuf:"bytes,4,opt,name=manifest_notification,json=manifestNotification,proto3" json:"manifest_notification,omitempty"` } func (x *Mutation) Reset() { *x = Mutation{} 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.StoreMessageInfo(mi) } @@ -113,7 +167,7 @@ func (x *Mutation) String() string { func (*Mutation) ProtoMessage() {} 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 { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -126,7 +180,7 @@ func (x *Mutation) ProtoReflect() protoreflect.Message { // Deprecated: Use Mutation.ProtoReflect.Descriptor instead. 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 { @@ -150,6 +204,13 @@ func (x *Mutation) GetRows() *Rows { return nil } +func (x *Mutation) GetManifestNotification() *ManifestNotification { + if x != nil { + return x.ManifestNotification + } + return nil +} + // A WAL entry contains a list of mutations for a region to write. type WalEntry struct { state protoimpl.MessageState @@ -163,7 +224,7 @@ type WalEntry struct { func (x *WalEntry) Reset() { *x = WalEntry{} 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.StoreMessageInfo(mi) } @@ -176,7 +237,7 @@ func (x *WalEntry) String() string { func (*WalEntry) ProtoMessage() {} 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 { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -189,7 +250,7 @@ func (x *WalEntry) ProtoReflect() protoreflect.Message { // Deprecated: Use WalEntry.ProtoReflect.Descriptor instead. 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 { @@ -205,25 +266,34 @@ var file_greptime_v1_wal_proto_rawDesc = []byte{ 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, 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, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x07, 0x6f, 0x70, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, - 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x6f, - 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x65, 0x12, 0x25, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, - 0x77, 0x73, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 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, 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, + 0x31, 0x2f, 0x72, 0x6f, 0x77, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x30, 0x0a, 0x14, 0x4d, + 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xd3, 0x01, + 0x0a, 0x08, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x07, 0x6f, 0x70, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x67, 0x72, + 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x06, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, + 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, + 0x65, 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x52, 0x6f, 0x77, 0x73, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x12, 0x56, 0x0a, 0x15, 0x6d, + 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x72, 0x65, + 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, + 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x14, 0x6d, + 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 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, 0x29, 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, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x59, 0x10, 0x02, 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 ( @@ -239,22 +309,24 @@ func file_greptime_v1_wal_proto_rawDescGZIP() []byte { } var file_greptime_v1_wal_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -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{}{ - (OpType)(0), // 0: greptime.v1.OpType - (*Mutation)(nil), // 1: greptime.v1.Mutation - (*WalEntry)(nil), // 2: greptime.v1.WalEntry - (*Rows)(nil), // 3: greptime.v1.Rows + (OpType)(0), // 0: greptime.v1.OpType + (*ManifestNotification)(nil), // 1: greptime.v1.ManifestNotification + (*Mutation)(nil), // 2: greptime.v1.Mutation + (*WalEntry)(nil), // 3: greptime.v1.WalEntry + (*Rows)(nil), // 4: greptime.v1.Rows } var file_greptime_v1_wal_proto_depIdxs = []int32{ 0, // 0: greptime.v1.Mutation.op_type:type_name -> greptime.v1.OpType - 3, // 1: greptime.v1.Mutation.rows:type_name -> greptime.v1.Rows - 1, // 2: greptime.v1.WalEntry.mutations:type_name -> greptime.v1.Mutation - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 4, // 1: greptime.v1.Mutation.rows:type_name -> greptime.v1.Rows + 1, // 2: greptime.v1.Mutation.manifest_notification:type_name -> greptime.v1.ManifestNotification + 2, // 3: greptime.v1.WalEntry.mutations:type_name -> greptime.v1.Mutation + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_greptime_v1_wal_proto_init() } @@ -265,7 +337,7 @@ func file_greptime_v1_wal_proto_init() { file_greptime_v1_row_proto_init() if !protoimpl.UnsafeEnabled { file_greptime_v1_wal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Mutation); i { + switch v := v.(*ManifestNotification); i { case 0: return &v.state case 1: @@ -277,6 +349,18 @@ func file_greptime_v1_wal_proto_init() { } } 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 { case 0: return &v.state @@ -295,7 +379,7 @@ func file_greptime_v1_wal_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_greptime_v1_wal_proto_rawDesc, NumEnums: 1, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/java/src/main/java/greptime/v1/Wal.java b/java/src/main/java/greptime/v1/Wal.java index 1ec61be6..bc1e6a52 100644 --- a/java/src/main/java/greptime/v1/Wal.java +++ b/java/src/main/java/greptime/v1/Wal.java @@ -39,6 +39,14 @@ public enum OpType * PUT = 1; */ PUT(1), + /** + *
+     * Notify manifest changes.
+     * 
+ * + * NOTIFY = 2; + */ + NOTIFY(2), UNRECOGNIZED(-1), ; @@ -58,6 +66,14 @@ public enum OpType * PUT = 1; */ public static final int PUT_VALUE = 1; + /** + *
+     * Notify manifest changes.
+     * 
+ * + * NOTIFY = 2; + */ + public static final int NOTIFY_VALUE = 2; public final int getNumber() { @@ -65,81 +81,581 @@ public final int getNumber() { throw new java.lang.IllegalArgumentException( "Can't get the number of an unknown enum value."); } - return value; - } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OpType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static OpType forNumber(int value) { + switch (value) { + case 0: return DELETE; + case 1: return PUT; + case 2: return NOTIFY; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + OpType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public OpType findValueByNumber(int number) { + return OpType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return greptime.v1.Wal.getDescriptor().getEnumTypes().get(0); + } + + private static final OpType[] VALUES = values(); + + public static OpType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private OpType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:greptime.v1.OpType) + } + + public interface ManifestNotificationOrBuilder extends + // @@protoc_insertion_point(interface_extends:greptime.v1.ManifestNotification) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 version = 1; + * @return The version. + */ + long getVersion(); + } + /** + *
+   * The manfeist notification content.
+   * 
+ * + * Protobuf type {@code greptime.v1.ManifestNotification} + */ + public static final class ManifestNotification extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:greptime.v1.ManifestNotification) + ManifestNotificationOrBuilder { + private static final long serialVersionUID = 0L; + // Use ManifestNotification.newBuilder() to construct. + private ManifestNotification(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ManifestNotification() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ManifestNotification(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ManifestNotification( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + version_ = input.readUInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return greptime.v1.Wal.internal_static_greptime_v1_ManifestNotification_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return greptime.v1.Wal.internal_static_greptime_v1_ManifestNotification_fieldAccessorTable + .ensureFieldAccessorsInitialized( + greptime.v1.Wal.ManifestNotification.class, greptime.v1.Wal.ManifestNotification.Builder.class); + } + + public static final int VERSION_FIELD_NUMBER = 1; + private long version_; + /** + * uint64 version = 1; + * @return The version. + */ + @java.lang.Override + public long getVersion() { + return version_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (version_ != 0L) { + output.writeUInt64(1, version_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (version_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, version_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof greptime.v1.Wal.ManifestNotification)) { + return super.equals(obj); + } + greptime.v1.Wal.ManifestNotification other = (greptime.v1.Wal.ManifestNotification) obj; + + if (getVersion() + != other.getVersion()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVersion()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static greptime.v1.Wal.ManifestNotification parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static greptime.v1.Wal.ManifestNotification parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static greptime.v1.Wal.ManifestNotification parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static greptime.v1.Wal.ManifestNotification parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static greptime.v1.Wal.ManifestNotification parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static greptime.v1.Wal.ManifestNotification parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static greptime.v1.Wal.ManifestNotification parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static greptime.v1.Wal.ManifestNotification parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static greptime.v1.Wal.ManifestNotification parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static greptime.v1.Wal.ManifestNotification parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static greptime.v1.Wal.ManifestNotification parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static greptime.v1.Wal.ManifestNotification parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(greptime.v1.Wal.ManifestNotification prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * The manfeist notification content.
+     * 
+ * + * Protobuf type {@code greptime.v1.ManifestNotification} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:greptime.v1.ManifestNotification) + greptime.v1.Wal.ManifestNotificationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return greptime.v1.Wal.internal_static_greptime_v1_ManifestNotification_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return greptime.v1.Wal.internal_static_greptime_v1_ManifestNotification_fieldAccessorTable + .ensureFieldAccessorsInitialized( + greptime.v1.Wal.ManifestNotification.class, greptime.v1.Wal.ManifestNotification.Builder.class); + } + + // Construct using greptime.v1.Wal.ManifestNotification.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + version_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return greptime.v1.Wal.internal_static_greptime_v1_ManifestNotification_descriptor; + } + + @java.lang.Override + public greptime.v1.Wal.ManifestNotification getDefaultInstanceForType() { + return greptime.v1.Wal.ManifestNotification.getDefaultInstance(); + } + + @java.lang.Override + public greptime.v1.Wal.ManifestNotification build() { + greptime.v1.Wal.ManifestNotification result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public greptime.v1.Wal.ManifestNotification buildPartial() { + greptime.v1.Wal.ManifestNotification result = new greptime.v1.Wal.ManifestNotification(this); + result.version_ = version_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof greptime.v1.Wal.ManifestNotification) { + return mergeFrom((greptime.v1.Wal.ManifestNotification)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(greptime.v1.Wal.ManifestNotification other) { + if (other == greptime.v1.Wal.ManifestNotification.getDefaultInstance()) return this; + if (other.getVersion() != 0L) { + setVersion(other.getVersion()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + greptime.v1.Wal.ManifestNotification parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (greptime.v1.Wal.ManifestNotification) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OpType valueOf(int value) { - return forNumber(value); - } + private long version_ ; + /** + * uint64 version = 1; + * @return The version. + */ + @java.lang.Override + public long getVersion() { + return version_; + } + /** + * uint64 version = 1; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(long value) { + + version_ = value; + onChanged(); + return this; + } + /** + * uint64 version = 1; + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static OpType forNumber(int value) { - switch (value) { - case 0: return DELETE; - case 1: return PUT; - default: return null; + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); } - } - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - OpType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public OpType findValueByNumber(int number) { - return OpType.forNumber(number); - } - }; - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); + // @@protoc_insertion_point(builder_scope:greptime.v1.ManifestNotification) } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return greptime.v1.Wal.getDescriptor().getEnumTypes().get(0); + + // @@protoc_insertion_point(class_scope:greptime.v1.ManifestNotification) + private static final greptime.v1.Wal.ManifestNotification DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new greptime.v1.Wal.ManifestNotification(); } - private static final OpType[] VALUES = values(); + public static greptime.v1.Wal.ManifestNotification getDefaultInstance() { + return DEFAULT_INSTANCE; + } - public static OpType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ManifestNotification parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ManifestNotification(input, extensionRegistry); } - return VALUES[desc.getIndex()]; + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; } - private final int value; + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } - private OpType(int value) { - this.value = value; + @java.lang.Override + public greptime.v1.Wal.ManifestNotification getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } - // @@protoc_insertion_point(enum_scope:greptime.v1.OpType) } public interface MutationOrBuilder extends @@ -201,6 +717,33 @@ public interface MutationOrBuilder extends * .greptime.v1.Rows rows = 3; */ io.greptime.v1.RowData.RowsOrBuilder getRowsOrBuilder(); + + /** + *
+     * The manifest change notification
+     * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + * @return Whether the manifestNotification field is set. + */ + boolean hasManifestNotification(); + /** + *
+     * The manifest change notification
+     * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + * @return The manifestNotification. + */ + greptime.v1.Wal.ManifestNotification getManifestNotification(); + /** + *
+     * The manifest change notification
+     * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + */ + greptime.v1.Wal.ManifestNotificationOrBuilder getManifestNotificationOrBuilder(); } /** *
@@ -276,6 +819,19 @@ private Mutation(
 
               break;
             }
+            case 34: {
+              greptime.v1.Wal.ManifestNotification.Builder subBuilder = null;
+              if (manifestNotification_ != null) {
+                subBuilder = manifestNotification_.toBuilder();
+              }
+              manifestNotification_ = input.readMessage(greptime.v1.Wal.ManifestNotification.parser(), extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(manifestNotification_);
+                manifestNotification_ = subBuilder.buildPartial();
+              }
+
+              break;
+            }
             default: {
               if (!parseUnknownField(
                   input, unknownFields, extensionRegistry, tag)) {
@@ -390,6 +946,44 @@ public io.greptime.v1.RowData.RowsOrBuilder getRowsOrBuilder() {
       return getRows();
     }
 
+    public static final int MANIFEST_NOTIFICATION_FIELD_NUMBER = 4;
+    private greptime.v1.Wal.ManifestNotification manifestNotification_;
+    /**
+     * 
+     * The manifest change notification
+     * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + * @return Whether the manifestNotification field is set. + */ + @java.lang.Override + public boolean hasManifestNotification() { + return manifestNotification_ != null; + } + /** + *
+     * The manifest change notification
+     * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + * @return The manifestNotification. + */ + @java.lang.Override + public greptime.v1.Wal.ManifestNotification getManifestNotification() { + return manifestNotification_ == null ? greptime.v1.Wal.ManifestNotification.getDefaultInstance() : manifestNotification_; + } + /** + *
+     * The manifest change notification
+     * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + */ + @java.lang.Override + public greptime.v1.Wal.ManifestNotificationOrBuilder getManifestNotificationOrBuilder() { + return getManifestNotification(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -413,6 +1007,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (rows_ != null) { output.writeMessage(3, getRows()); } + if (manifestNotification_ != null) { + output.writeMessage(4, getManifestNotification()); + } unknownFields.writeTo(output); } @@ -434,6 +1031,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, getRows()); } + if (manifestNotification_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getManifestNotification()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -457,6 +1058,11 @@ public boolean equals(final java.lang.Object obj) { if (!getRows() .equals(other.getRows())) return false; } + if (hasManifestNotification() != other.hasManifestNotification()) return false; + if (hasManifestNotification()) { + if (!getManifestNotification() + .equals(other.getManifestNotification())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -477,6 +1083,10 @@ public int hashCode() { hash = (37 * hash) + ROWS_FIELD_NUMBER; hash = (53 * hash) + getRows().hashCode(); } + if (hasManifestNotification()) { + hash = (37 * hash) + MANIFEST_NOTIFICATION_FIELD_NUMBER; + hash = (53 * hash) + getManifestNotification().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -624,6 +1234,12 @@ public Builder clear() { rows_ = null; rowsBuilder_ = null; } + if (manifestNotificationBuilder_ == null) { + manifestNotification_ = null; + } else { + manifestNotification_ = null; + manifestNotificationBuilder_ = null; + } return this; } @@ -657,6 +1273,11 @@ public greptime.v1.Wal.Mutation buildPartial() { } else { result.rows_ = rowsBuilder_.build(); } + if (manifestNotificationBuilder_ == null) { + result.manifestNotification_ = manifestNotification_; + } else { + result.manifestNotification_ = manifestNotificationBuilder_.build(); + } onBuilt(); return result; } @@ -714,6 +1335,9 @@ public Builder mergeFrom(greptime.v1.Wal.Mutation other) { if (other.hasRows()) { mergeRows(other.getRows()); } + if (other.hasManifestNotification()) { + mergeManifestNotification(other.getManifestNotification()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1014,6 +1638,161 @@ public io.greptime.v1.RowData.RowsOrBuilder getRowsOrBuilder() { } return rowsBuilder_; } + + private greptime.v1.Wal.ManifestNotification manifestNotification_; + private com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.Wal.ManifestNotification, greptime.v1.Wal.ManifestNotification.Builder, greptime.v1.Wal.ManifestNotificationOrBuilder> manifestNotificationBuilder_; + /** + *
+       * The manifest change notification
+       * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + * @return Whether the manifestNotification field is set. + */ + public boolean hasManifestNotification() { + return manifestNotificationBuilder_ != null || manifestNotification_ != null; + } + /** + *
+       * The manifest change notification
+       * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + * @return The manifestNotification. + */ + public greptime.v1.Wal.ManifestNotification getManifestNotification() { + if (manifestNotificationBuilder_ == null) { + return manifestNotification_ == null ? greptime.v1.Wal.ManifestNotification.getDefaultInstance() : manifestNotification_; + } else { + return manifestNotificationBuilder_.getMessage(); + } + } + /** + *
+       * The manifest change notification
+       * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + */ + public Builder setManifestNotification(greptime.v1.Wal.ManifestNotification value) { + if (manifestNotificationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + manifestNotification_ = value; + onChanged(); + } else { + manifestNotificationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The manifest change notification
+       * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + */ + public Builder setManifestNotification( + greptime.v1.Wal.ManifestNotification.Builder builderForValue) { + if (manifestNotificationBuilder_ == null) { + manifestNotification_ = builderForValue.build(); + onChanged(); + } else { + manifestNotificationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The manifest change notification
+       * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + */ + public Builder mergeManifestNotification(greptime.v1.Wal.ManifestNotification value) { + if (manifestNotificationBuilder_ == null) { + if (manifestNotification_ != null) { + manifestNotification_ = + greptime.v1.Wal.ManifestNotification.newBuilder(manifestNotification_).mergeFrom(value).buildPartial(); + } else { + manifestNotification_ = value; + } + onChanged(); + } else { + manifestNotificationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The manifest change notification
+       * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + */ + public Builder clearManifestNotification() { + if (manifestNotificationBuilder_ == null) { + manifestNotification_ = null; + onChanged(); + } else { + manifestNotification_ = null; + manifestNotificationBuilder_ = null; + } + + return this; + } + /** + *
+       * The manifest change notification
+       * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + */ + public greptime.v1.Wal.ManifestNotification.Builder getManifestNotificationBuilder() { + + onChanged(); + return getManifestNotificationFieldBuilder().getBuilder(); + } + /** + *
+       * The manifest change notification
+       * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + */ + public greptime.v1.Wal.ManifestNotificationOrBuilder getManifestNotificationOrBuilder() { + if (manifestNotificationBuilder_ != null) { + return manifestNotificationBuilder_.getMessageOrBuilder(); + } else { + return manifestNotification_ == null ? + greptime.v1.Wal.ManifestNotification.getDefaultInstance() : manifestNotification_; + } + } + /** + *
+       * The manifest change notification
+       * 
+ * + * .greptime.v1.ManifestNotification manifest_notification = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.Wal.ManifestNotification, greptime.v1.Wal.ManifestNotification.Builder, greptime.v1.Wal.ManifestNotificationOrBuilder> + getManifestNotificationFieldBuilder() { + if (manifestNotificationBuilder_ == null) { + manifestNotificationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.Wal.ManifestNotification, greptime.v1.Wal.ManifestNotification.Builder, greptime.v1.Wal.ManifestNotificationOrBuilder>( + getManifestNotification(), + getParentForChildren(), + isClean()); + manifestNotification_ = null; + } + return manifestNotificationBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -1982,6 +2761,11 @@ public greptime.v1.Wal.WalEntry getDefaultInstanceForType() { } + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_greptime_v1_ManifestNotification_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_greptime_v1_ManifestNotification_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_greptime_v1_Mutation_descriptor; private static final @@ -2002,12 +2786,15 @@ public greptime.v1.Wal.WalEntry getDefaultInstanceForType() { static { java.lang.String[] descriptorData = { "\n\025greptime/v1/wal.proto\022\013greptime.v1\032\025gr" + - "eptime/v1/row.proto\"c\n\010Mutation\022$\n\007op_ty" + - "pe\030\001 \001(\0162\023.greptime.v1.OpType\022\020\n\010sequenc" + - "e\030\002 \001(\004\022\037\n\004rows\030\003 \001(\0132\021.greptime.v1.Rows" + - "\"4\n\010WalEntry\022(\n\tmutations\030\001 \003(\0132\025.grepti" + - "me.v1.Mutation*\035\n\006OpType\022\n\n\006DELETE\020\000\022\007\n\003" + - "PUT\020\001B7Z5github.com/GreptimeTeam/greptim" + + "eptime/v1/row.proto\"\'\n\024ManifestNotificat" + + "ion\022\017\n\007version\030\001 \001(\004\"\245\001\n\010Mutation\022$\n\007op_" + + "type\030\001 \001(\0162\023.greptime.v1.OpType\022\020\n\010seque" + + "nce\030\002 \001(\004\022\037\n\004rows\030\003 \001(\0132\021.greptime.v1.Ro" + + "ws\022@\n\025manifest_notification\030\004 \001(\0132!.grep" + + "time.v1.ManifestNotification\"4\n\010WalEntry" + + "\022(\n\tmutations\030\001 \003(\0132\025.greptime.v1.Mutati" + + "on*)\n\006OpType\022\n\n\006DELETE\020\000\022\007\n\003PUT\020\001\022\n\n\006NOT" + + "IFY\020\002B7Z5github.com/GreptimeTeam/greptim" + "e-proto/go/greptime/v1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor @@ -2015,14 +2802,20 @@ public greptime.v1.Wal.WalEntry getDefaultInstanceForType() { new com.google.protobuf.Descriptors.FileDescriptor[] { io.greptime.v1.RowData.getDescriptor(), }); - internal_static_greptime_v1_Mutation_descriptor = + internal_static_greptime_v1_ManifestNotification_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_greptime_v1_ManifestNotification_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_greptime_v1_ManifestNotification_descriptor, + new java.lang.String[] { "Version", }); + internal_static_greptime_v1_Mutation_descriptor = + getDescriptor().getMessageTypes().get(1); internal_static_greptime_v1_Mutation_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greptime_v1_Mutation_descriptor, - new java.lang.String[] { "OpType", "Sequence", "Rows", }); + new java.lang.String[] { "OpType", "Sequence", "Rows", "ManifestNotification", }); internal_static_greptime_v1_WalEntry_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageTypes().get(2); internal_static_greptime_v1_WalEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greptime_v1_WalEntry_descriptor, diff --git a/proto/greptime/v1/wal.proto b/proto/greptime/v1/wal.proto index 1ca9d39c..e5185d8b 100644 --- a/proto/greptime/v1/wal.proto +++ b/proto/greptime/v1/wal.proto @@ -26,6 +26,13 @@ enum OpType { DELETE = 0; // Put rows. PUT = 1; + // Notify manifest changes. + NOTIFY = 2; +} + +// The manfeist notification content. +message ManifestNotification { + uint64 version = 1; } // Mutation contains updates to a set of rows. @@ -36,6 +43,8 @@ message Mutation { uint64 sequence = 2; // Row updates to write to the WAL. Rows rows = 3; + // The manifest change notification + ManifestNotification manifest_notification = 4; } // A WAL entry contains a list of mutations for a region to write.