diff --git a/native/cpp/CommonCpp/grpc/_generated/backup.pb.h b/native/cpp/CommonCpp/grpc/_generated/backup.pb.h --- a/native/cpp/CommonCpp/grpc/_generated/backup.pb.h +++ b/native/cpp/CommonCpp/grpc/_generated/backup.pb.h @@ -47,7 +47,7 @@ PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[7] + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[8] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; @@ -68,6 +68,9 @@ class PullBackupResponse; struct PullBackupResponseDefaultTypeInternal; extern PullBackupResponseDefaultTypeInternal _PullBackupResponse_default_instance_; +class PullBackupResponse_InnerPullBackupResponse; +struct PullBackupResponse_InnerPullBackupResponseDefaultTypeInternal; +extern PullBackupResponse_InnerPullBackupResponseDefaultTypeInternal _PullBackupResponse_InnerPullBackupResponse_default_instance_; class RecoverBackupKeyRequest; struct RecoverBackupKeyRequestDefaultTypeInternal; extern RecoverBackupKeyRequestDefaultTypeInternal _RecoverBackupKeyRequest_default_instance_; @@ -83,6 +86,7 @@ template<> ::backup::CreateNewBackupResponse* Arena::CreateMaybeMessage<::backup::CreateNewBackupResponse>(Arena*); template<> ::backup::PullBackupRequest* Arena::CreateMaybeMessage<::backup::PullBackupRequest>(Arena*); template<> ::backup::PullBackupResponse* Arena::CreateMaybeMessage<::backup::PullBackupResponse>(Arena*); +template<> ::backup::PullBackupResponse_InnerPullBackupResponse* Arena::CreateMaybeMessage<::backup::PullBackupResponse_InnerPullBackupResponse>(Arena*); template<> ::backup::RecoverBackupKeyRequest* Arena::CreateMaybeMessage<::backup::RecoverBackupKeyRequest>(Arena*); template<> ::backup::RecoverBackupKeyResponse* Arena::CreateMaybeMessage<::backup::RecoverBackupKeyResponse>(Arena*); template<> ::backup::SendLogRequest* Arena::CreateMaybeMessage<::backup::SendLogRequest>(Arena*); @@ -1159,24 +1163,24 @@ }; // ------------------------------------------------------------------- -class PullBackupResponse PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:backup.PullBackupResponse) */ { +class PullBackupResponse_InnerPullBackupResponse PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:backup.PullBackupResponse.InnerPullBackupResponse) */ { public: - inline PullBackupResponse() : PullBackupResponse(nullptr) {} - virtual ~PullBackupResponse(); - explicit constexpr PullBackupResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline PullBackupResponse_InnerPullBackupResponse() : PullBackupResponse_InnerPullBackupResponse(nullptr) {} + virtual ~PullBackupResponse_InnerPullBackupResponse(); + explicit constexpr PullBackupResponse_InnerPullBackupResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - PullBackupResponse(const PullBackupResponse& from); - PullBackupResponse(PullBackupResponse&& from) noexcept - : PullBackupResponse() { + PullBackupResponse_InnerPullBackupResponse(const PullBackupResponse_InnerPullBackupResponse& from); + PullBackupResponse_InnerPullBackupResponse(PullBackupResponse_InnerPullBackupResponse&& from) noexcept + : PullBackupResponse_InnerPullBackupResponse() { *this = ::std::move(from); } - inline PullBackupResponse& operator=(const PullBackupResponse& from) { + inline PullBackupResponse_InnerPullBackupResponse& operator=(const PullBackupResponse_InnerPullBackupResponse& from) { CopyFrom(from); return *this; } - inline PullBackupResponse& operator=(PullBackupResponse&& from) noexcept { + inline PullBackupResponse_InnerPullBackupResponse& operator=(PullBackupResponse_InnerPullBackupResponse&& from) noexcept { if (GetArena() == from.GetArena()) { if (this != &from) InternalSwap(&from); } else { @@ -1194,26 +1198,27 @@ static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return GetMetadataStatic().reflection; } - static const PullBackupResponse& default_instance() { + static const PullBackupResponse_InnerPullBackupResponse& default_instance() { return *internal_default_instance(); } enum DataCase { kCompactionChunk = 1, - kLogChunk = 2, + kAttachmentHolder = 2, + kLogChunk = 3, DATA_NOT_SET = 0, }; - static inline const PullBackupResponse* internal_default_instance() { - return reinterpret_cast( - &_PullBackupResponse_default_instance_); + static inline const PullBackupResponse_InnerPullBackupResponse* internal_default_instance() { + return reinterpret_cast( + &_PullBackupResponse_InnerPullBackupResponse_default_instance_); } static constexpr int kIndexInFileMessages = 6; - friend void swap(PullBackupResponse& a, PullBackupResponse& b) { + friend void swap(PullBackupResponse_InnerPullBackupResponse& a, PullBackupResponse_InnerPullBackupResponse& b) { a.Swap(&b); } - inline void Swap(PullBackupResponse* other) { + inline void Swap(PullBackupResponse_InnerPullBackupResponse* other) { if (other == this) return; if (GetArena() == other->GetArena()) { InternalSwap(other); @@ -1221,7 +1226,7 @@ ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(PullBackupResponse* other) { + void UnsafeArenaSwap(PullBackupResponse_InnerPullBackupResponse* other) { if (other == this) return; GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -1229,17 +1234,17 @@ // implements Message ---------------------------------------------- - inline PullBackupResponse* New() const final { - return CreateMaybeMessage(nullptr); + inline PullBackupResponse_InnerPullBackupResponse* New() const final { + return CreateMaybeMessage(nullptr); } - PullBackupResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); + PullBackupResponse_InnerPullBackupResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); } void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const PullBackupResponse& from); - void MergeFrom(const PullBackupResponse& from); + void CopyFrom(const PullBackupResponse_InnerPullBackupResponse& from); + void MergeFrom(const PullBackupResponse_InnerPullBackupResponse& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1253,13 +1258,13 @@ inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(PullBackupResponse* other); + void InternalSwap(PullBackupResponse_InnerPullBackupResponse* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "backup.PullBackupResponse"; + return "backup.PullBackupResponse.InnerPullBackupResponse"; } protected: - explicit PullBackupResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + explicit PullBackupResponse_InnerPullBackupResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); @@ -1279,7 +1284,8 @@ enum : int { kCompactionChunkFieldNumber = 1, - kLogChunkFieldNumber = 2, + kAttachmentHolderFieldNumber = 2, + kLogChunkFieldNumber = 3, }; // bytes compactionChunk = 1; bool has_compactionchunk() const; @@ -1301,7 +1307,27 @@ std::string* _internal_mutable_compactionchunk(); public: - // bytes logChunk = 2; + // string attachmentHolder = 2; + bool has_attachmentholder() const; + private: + bool _internal_has_attachmentholder() const; + public: + void clear_attachmentholder(); + const std::string& attachmentholder() const; + void set_attachmentholder(const std::string& value); + void set_attachmentholder(std::string&& value); + void set_attachmentholder(const char* value); + void set_attachmentholder(const char* value, size_t size); + std::string* mutable_attachmentholder(); + std::string* release_attachmentholder(); + void set_allocated_attachmentholder(std::string* attachmentholder); + private: + const std::string& _internal_attachmentholder() const; + void _internal_set_attachmentholder(const std::string& value); + std::string* _internal_mutable_attachmentholder(); + public: + + // bytes logChunk = 3; bool has_logchunk() const; private: bool _internal_has_logchunk() const; @@ -1323,10 +1349,11 @@ void clear_data(); DataCase data_case() const; - // @@protoc_insertion_point(class_scope:backup.PullBackupResponse) + // @@protoc_insertion_point(class_scope:backup.PullBackupResponse.InnerPullBackupResponse) private: class _Internal; void set_has_compactionchunk(); + void set_has_attachmentholder(); void set_has_logchunk(); inline bool has_data() const; @@ -1339,6 +1366,7 @@ constexpr DataUnion() : _constinit_{} {} ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr compactionchunk_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr attachmentholder_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr logchunk_; } data_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; @@ -1346,6 +1374,154 @@ friend struct ::TableStruct_backup_2eproto; }; +// ------------------------------------------------------------------- + +class PullBackupResponse PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:backup.PullBackupResponse) */ { + public: + inline PullBackupResponse() : PullBackupResponse(nullptr) {} + virtual ~PullBackupResponse(); + explicit constexpr PullBackupResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PullBackupResponse(const PullBackupResponse& from); + PullBackupResponse(PullBackupResponse&& from) noexcept + : PullBackupResponse() { + *this = ::std::move(from); + } + + inline PullBackupResponse& operator=(const PullBackupResponse& from) { + CopyFrom(from); + return *this; + } + inline PullBackupResponse& operator=(PullBackupResponse&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const PullBackupResponse& default_instance() { + return *internal_default_instance(); + } + static inline const PullBackupResponse* internal_default_instance() { + return reinterpret_cast( + &_PullBackupResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + friend void swap(PullBackupResponse& a, PullBackupResponse& b) { + a.Swap(&b); + } + inline void Swap(PullBackupResponse* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PullBackupResponse* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline PullBackupResponse* New() const final { + return CreateMaybeMessage(nullptr); + } + + PullBackupResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const PullBackupResponse& from); + void MergeFrom(const PullBackupResponse& from); + 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; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PullBackupResponse* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "backup.PullBackupResponse"; + } + protected: + explicit PullBackupResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + return ::descriptor_table_backup_2eproto_metadata_getter(kIndexInFileMessages); + } + + public: + + // nested types ---------------------------------------------------- + + typedef PullBackupResponse_InnerPullBackupResponse InnerPullBackupResponse; + + // accessors ------------------------------------------------------- + + enum : int { + kInnerFieldNumber = 1, + }; + // repeated .backup.PullBackupResponse.InnerPullBackupResponse inner = 1; + int inner_size() const; + private: + int _internal_inner_size() const; + public: + void clear_inner(); + ::backup::PullBackupResponse_InnerPullBackupResponse* mutable_inner(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::backup::PullBackupResponse_InnerPullBackupResponse >* + mutable_inner(); + private: + const ::backup::PullBackupResponse_InnerPullBackupResponse& _internal_inner(int index) const; + ::backup::PullBackupResponse_InnerPullBackupResponse* _internal_add_inner(); + public: + const ::backup::PullBackupResponse_InnerPullBackupResponse& inner(int index) const; + ::backup::PullBackupResponse_InnerPullBackupResponse* add_inner(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::backup::PullBackupResponse_InnerPullBackupResponse >& + inner() const; + + // @@protoc_insertion_point(class_scope:backup.PullBackupResponse) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::backup::PullBackupResponse_InnerPullBackupResponse > inner_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_backup_2eproto; +}; // =================================================================== @@ -2582,43 +2758,43 @@ // ------------------------------------------------------------------- -// PullBackupResponse +// PullBackupResponse_InnerPullBackupResponse // bytes compactionChunk = 1; -inline bool PullBackupResponse::_internal_has_compactionchunk() const { +inline bool PullBackupResponse_InnerPullBackupResponse::_internal_has_compactionchunk() const { return data_case() == kCompactionChunk; } -inline bool PullBackupResponse::has_compactionchunk() const { +inline bool PullBackupResponse_InnerPullBackupResponse::has_compactionchunk() const { return _internal_has_compactionchunk(); } -inline void PullBackupResponse::set_has_compactionchunk() { +inline void PullBackupResponse_InnerPullBackupResponse::set_has_compactionchunk() { _oneof_case_[0] = kCompactionChunk; } -inline void PullBackupResponse::clear_compactionchunk() { +inline void PullBackupResponse_InnerPullBackupResponse::clear_compactionchunk() { if (_internal_has_compactionchunk()) { data_.compactionchunk_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); clear_has_data(); } } -inline const std::string& PullBackupResponse::compactionchunk() const { - // @@protoc_insertion_point(field_get:backup.PullBackupResponse.compactionChunk) +inline const std::string& PullBackupResponse_InnerPullBackupResponse::compactionchunk() const { + // @@protoc_insertion_point(field_get:backup.PullBackupResponse.InnerPullBackupResponse.compactionChunk) return _internal_compactionchunk(); } -inline void PullBackupResponse::set_compactionchunk(const std::string& value) { +inline void PullBackupResponse_InnerPullBackupResponse::set_compactionchunk(const std::string& value) { _internal_set_compactionchunk(value); - // @@protoc_insertion_point(field_set:backup.PullBackupResponse.compactionChunk) + // @@protoc_insertion_point(field_set:backup.PullBackupResponse.InnerPullBackupResponse.compactionChunk) } -inline std::string* PullBackupResponse::mutable_compactionchunk() { - // @@protoc_insertion_point(field_mutable:backup.PullBackupResponse.compactionChunk) +inline std::string* PullBackupResponse_InnerPullBackupResponse::mutable_compactionchunk() { + // @@protoc_insertion_point(field_mutable:backup.PullBackupResponse.InnerPullBackupResponse.compactionChunk) return _internal_mutable_compactionchunk(); } -inline const std::string& PullBackupResponse::_internal_compactionchunk() const { +inline const std::string& PullBackupResponse_InnerPullBackupResponse::_internal_compactionchunk() const { if (_internal_has_compactionchunk()) { return data_.compactionchunk_.Get(); } return ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(); } -inline void PullBackupResponse::_internal_set_compactionchunk(const std::string& value) { +inline void PullBackupResponse_InnerPullBackupResponse::_internal_set_compactionchunk(const std::string& value) { if (!_internal_has_compactionchunk()) { clear_data(); set_has_compactionchunk(); @@ -2626,8 +2802,8 @@ } data_.compactionchunk_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena()); } -inline void PullBackupResponse::set_compactionchunk(std::string&& value) { - // @@protoc_insertion_point(field_set:backup.PullBackupResponse.compactionChunk) +inline void PullBackupResponse_InnerPullBackupResponse::set_compactionchunk(std::string&& value) { + // @@protoc_insertion_point(field_set:backup.PullBackupResponse.InnerPullBackupResponse.compactionChunk) if (!_internal_has_compactionchunk()) { clear_data(); set_has_compactionchunk(); @@ -2635,9 +2811,9 @@ } data_.compactionchunk_.Set( ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena()); - // @@protoc_insertion_point(field_set_rvalue:backup.PullBackupResponse.compactionChunk) + // @@protoc_insertion_point(field_set_rvalue:backup.PullBackupResponse.InnerPullBackupResponse.compactionChunk) } -inline void PullBackupResponse::set_compactionchunk(const char* value) { +inline void PullBackupResponse_InnerPullBackupResponse::set_compactionchunk(const char* value) { GOOGLE_DCHECK(value != nullptr); if (!_internal_has_compactionchunk()) { clear_data(); @@ -2646,9 +2822,9 @@ } data_.compactionchunk_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena()); - // @@protoc_insertion_point(field_set_char:backup.PullBackupResponse.compactionChunk) + // @@protoc_insertion_point(field_set_char:backup.PullBackupResponse.InnerPullBackupResponse.compactionChunk) } -inline void PullBackupResponse::set_compactionchunk(const void* value, +inline void PullBackupResponse_InnerPullBackupResponse::set_compactionchunk(const void* value, size_t size) { if (!_internal_has_compactionchunk()) { clear_data(); @@ -2659,9 +2835,9 @@ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string( reinterpret_cast(value), size), GetArena()); - // @@protoc_insertion_point(field_set_pointer:backup.PullBackupResponse.compactionChunk) + // @@protoc_insertion_point(field_set_pointer:backup.PullBackupResponse.InnerPullBackupResponse.compactionChunk) } -inline std::string* PullBackupResponse::_internal_mutable_compactionchunk() { +inline std::string* PullBackupResponse_InnerPullBackupResponse::_internal_mutable_compactionchunk() { if (!_internal_has_compactionchunk()) { clear_data(); set_has_compactionchunk(); @@ -2670,8 +2846,8 @@ return data_.compactionchunk_.Mutable( ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); } -inline std::string* PullBackupResponse::release_compactionchunk() { - // @@protoc_insertion_point(field_release:backup.PullBackupResponse.compactionChunk) +inline std::string* PullBackupResponse_InnerPullBackupResponse::release_compactionchunk() { + // @@protoc_insertion_point(field_release:backup.PullBackupResponse.InnerPullBackupResponse.compactionChunk) if (_internal_has_compactionchunk()) { clear_has_data(); return data_.compactionchunk_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); @@ -2679,7 +2855,7 @@ return nullptr; } } -inline void PullBackupResponse::set_allocated_compactionchunk(std::string* compactionchunk) { +inline void PullBackupResponse_InnerPullBackupResponse::set_allocated_compactionchunk(std::string* compactionchunk) { if (has_data()) { clear_data(); } @@ -2691,44 +2867,154 @@ arena->Own(compactionchunk); } } - // @@protoc_insertion_point(field_set_allocated:backup.PullBackupResponse.compactionChunk) + // @@protoc_insertion_point(field_set_allocated:backup.PullBackupResponse.InnerPullBackupResponse.compactionChunk) } -// bytes logChunk = 2; -inline bool PullBackupResponse::_internal_has_logchunk() const { +// string attachmentHolder = 2; +inline bool PullBackupResponse_InnerPullBackupResponse::_internal_has_attachmentholder() const { + return data_case() == kAttachmentHolder; +} +inline bool PullBackupResponse_InnerPullBackupResponse::has_attachmentholder() const { + return _internal_has_attachmentholder(); +} +inline void PullBackupResponse_InnerPullBackupResponse::set_has_attachmentholder() { + _oneof_case_[0] = kAttachmentHolder; +} +inline void PullBackupResponse_InnerPullBackupResponse::clear_attachmentholder() { + if (_internal_has_attachmentholder()) { + data_.attachmentholder_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); + clear_has_data(); + } +} +inline const std::string& PullBackupResponse_InnerPullBackupResponse::attachmentholder() const { + // @@protoc_insertion_point(field_get:backup.PullBackupResponse.InnerPullBackupResponse.attachmentHolder) + return _internal_attachmentholder(); +} +inline void PullBackupResponse_InnerPullBackupResponse::set_attachmentholder(const std::string& value) { + _internal_set_attachmentholder(value); + // @@protoc_insertion_point(field_set:backup.PullBackupResponse.InnerPullBackupResponse.attachmentHolder) +} +inline std::string* PullBackupResponse_InnerPullBackupResponse::mutable_attachmentholder() { + // @@protoc_insertion_point(field_mutable:backup.PullBackupResponse.InnerPullBackupResponse.attachmentHolder) + return _internal_mutable_attachmentholder(); +} +inline const std::string& PullBackupResponse_InnerPullBackupResponse::_internal_attachmentholder() const { + if (_internal_has_attachmentholder()) { + return data_.attachmentholder_.Get(); + } + return ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(); +} +inline void PullBackupResponse_InnerPullBackupResponse::_internal_set_attachmentholder(const std::string& value) { + if (!_internal_has_attachmentholder()) { + clear_data(); + set_has_attachmentholder(); + data_.attachmentholder_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + } + data_.attachmentholder_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena()); +} +inline void PullBackupResponse_InnerPullBackupResponse::set_attachmentholder(std::string&& value) { + // @@protoc_insertion_point(field_set:backup.PullBackupResponse.InnerPullBackupResponse.attachmentHolder) + if (!_internal_has_attachmentholder()) { + clear_data(); + set_has_attachmentholder(); + data_.attachmentholder_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + } + data_.attachmentholder_.Set( + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:backup.PullBackupResponse.InnerPullBackupResponse.attachmentHolder) +} +inline void PullBackupResponse_InnerPullBackupResponse::set_attachmentholder(const char* value) { + GOOGLE_DCHECK(value != nullptr); + if (!_internal_has_attachmentholder()) { + clear_data(); + set_has_attachmentholder(); + data_.attachmentholder_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + } + data_.attachmentholder_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, + ::std::string(value), GetArena()); + // @@protoc_insertion_point(field_set_char:backup.PullBackupResponse.InnerPullBackupResponse.attachmentHolder) +} +inline void PullBackupResponse_InnerPullBackupResponse::set_attachmentholder(const char* value, + size_t size) { + if (!_internal_has_attachmentholder()) { + clear_data(); + set_has_attachmentholder(); + data_.attachmentholder_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + } + data_.attachmentholder_.Set( + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string( + reinterpret_cast(value), size), + GetArena()); + // @@protoc_insertion_point(field_set_pointer:backup.PullBackupResponse.InnerPullBackupResponse.attachmentHolder) +} +inline std::string* PullBackupResponse_InnerPullBackupResponse::_internal_mutable_attachmentholder() { + if (!_internal_has_attachmentholder()) { + clear_data(); + set_has_attachmentholder(); + data_.attachmentholder_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + } + return data_.attachmentholder_.Mutable( + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); +} +inline std::string* PullBackupResponse_InnerPullBackupResponse::release_attachmentholder() { + // @@protoc_insertion_point(field_release:backup.PullBackupResponse.InnerPullBackupResponse.attachmentHolder) + if (_internal_has_attachmentholder()) { + clear_has_data(); + return data_.attachmentholder_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + } else { + return nullptr; + } +} +inline void PullBackupResponse_InnerPullBackupResponse::set_allocated_attachmentholder(std::string* attachmentholder) { + if (has_data()) { + clear_data(); + } + if (attachmentholder != nullptr) { + set_has_attachmentholder(); + data_.attachmentholder_.UnsafeSetDefault(attachmentholder); + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); + if (arena != nullptr) { + arena->Own(attachmentholder); + } + } + // @@protoc_insertion_point(field_set_allocated:backup.PullBackupResponse.InnerPullBackupResponse.attachmentHolder) +} + +// bytes logChunk = 3; +inline bool PullBackupResponse_InnerPullBackupResponse::_internal_has_logchunk() const { return data_case() == kLogChunk; } -inline bool PullBackupResponse::has_logchunk() const { +inline bool PullBackupResponse_InnerPullBackupResponse::has_logchunk() const { return _internal_has_logchunk(); } -inline void PullBackupResponse::set_has_logchunk() { +inline void PullBackupResponse_InnerPullBackupResponse::set_has_logchunk() { _oneof_case_[0] = kLogChunk; } -inline void PullBackupResponse::clear_logchunk() { +inline void PullBackupResponse_InnerPullBackupResponse::clear_logchunk() { if (_internal_has_logchunk()) { data_.logchunk_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); clear_has_data(); } } -inline const std::string& PullBackupResponse::logchunk() const { - // @@protoc_insertion_point(field_get:backup.PullBackupResponse.logChunk) +inline const std::string& PullBackupResponse_InnerPullBackupResponse::logchunk() const { + // @@protoc_insertion_point(field_get:backup.PullBackupResponse.InnerPullBackupResponse.logChunk) return _internal_logchunk(); } -inline void PullBackupResponse::set_logchunk(const std::string& value) { +inline void PullBackupResponse_InnerPullBackupResponse::set_logchunk(const std::string& value) { _internal_set_logchunk(value); - // @@protoc_insertion_point(field_set:backup.PullBackupResponse.logChunk) + // @@protoc_insertion_point(field_set:backup.PullBackupResponse.InnerPullBackupResponse.logChunk) } -inline std::string* PullBackupResponse::mutable_logchunk() { - // @@protoc_insertion_point(field_mutable:backup.PullBackupResponse.logChunk) +inline std::string* PullBackupResponse_InnerPullBackupResponse::mutable_logchunk() { + // @@protoc_insertion_point(field_mutable:backup.PullBackupResponse.InnerPullBackupResponse.logChunk) return _internal_mutable_logchunk(); } -inline const std::string& PullBackupResponse::_internal_logchunk() const { +inline const std::string& PullBackupResponse_InnerPullBackupResponse::_internal_logchunk() const { if (_internal_has_logchunk()) { return data_.logchunk_.Get(); } return ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(); } -inline void PullBackupResponse::_internal_set_logchunk(const std::string& value) { +inline void PullBackupResponse_InnerPullBackupResponse::_internal_set_logchunk(const std::string& value) { if (!_internal_has_logchunk()) { clear_data(); set_has_logchunk(); @@ -2736,8 +3022,8 @@ } data_.logchunk_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena()); } -inline void PullBackupResponse::set_logchunk(std::string&& value) { - // @@protoc_insertion_point(field_set:backup.PullBackupResponse.logChunk) +inline void PullBackupResponse_InnerPullBackupResponse::set_logchunk(std::string&& value) { + // @@protoc_insertion_point(field_set:backup.PullBackupResponse.InnerPullBackupResponse.logChunk) if (!_internal_has_logchunk()) { clear_data(); set_has_logchunk(); @@ -2745,9 +3031,9 @@ } data_.logchunk_.Set( ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena()); - // @@protoc_insertion_point(field_set_rvalue:backup.PullBackupResponse.logChunk) + // @@protoc_insertion_point(field_set_rvalue:backup.PullBackupResponse.InnerPullBackupResponse.logChunk) } -inline void PullBackupResponse::set_logchunk(const char* value) { +inline void PullBackupResponse_InnerPullBackupResponse::set_logchunk(const char* value) { GOOGLE_DCHECK(value != nullptr); if (!_internal_has_logchunk()) { clear_data(); @@ -2756,9 +3042,9 @@ } data_.logchunk_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena()); - // @@protoc_insertion_point(field_set_char:backup.PullBackupResponse.logChunk) + // @@protoc_insertion_point(field_set_char:backup.PullBackupResponse.InnerPullBackupResponse.logChunk) } -inline void PullBackupResponse::set_logchunk(const void* value, +inline void PullBackupResponse_InnerPullBackupResponse::set_logchunk(const void* value, size_t size) { if (!_internal_has_logchunk()) { clear_data(); @@ -2769,9 +3055,9 @@ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string( reinterpret_cast(value), size), GetArena()); - // @@protoc_insertion_point(field_set_pointer:backup.PullBackupResponse.logChunk) + // @@protoc_insertion_point(field_set_pointer:backup.PullBackupResponse.InnerPullBackupResponse.logChunk) } -inline std::string* PullBackupResponse::_internal_mutable_logchunk() { +inline std::string* PullBackupResponse_InnerPullBackupResponse::_internal_mutable_logchunk() { if (!_internal_has_logchunk()) { clear_data(); set_has_logchunk(); @@ -2780,8 +3066,8 @@ return data_.logchunk_.Mutable( ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); } -inline std::string* PullBackupResponse::release_logchunk() { - // @@protoc_insertion_point(field_release:backup.PullBackupResponse.logChunk) +inline std::string* PullBackupResponse_InnerPullBackupResponse::release_logchunk() { + // @@protoc_insertion_point(field_release:backup.PullBackupResponse.InnerPullBackupResponse.logChunk) if (_internal_has_logchunk()) { clear_has_data(); return data_.logchunk_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); @@ -2789,7 +3075,7 @@ return nullptr; } } -inline void PullBackupResponse::set_allocated_logchunk(std::string* logchunk) { +inline void PullBackupResponse_InnerPullBackupResponse::set_allocated_logchunk(std::string* logchunk) { if (has_data()) { clear_data(); } @@ -2801,18 +3087,61 @@ arena->Own(logchunk); } } - // @@protoc_insertion_point(field_set_allocated:backup.PullBackupResponse.logChunk) + // @@protoc_insertion_point(field_set_allocated:backup.PullBackupResponse.InnerPullBackupResponse.logChunk) } -inline bool PullBackupResponse::has_data() const { +inline bool PullBackupResponse_InnerPullBackupResponse::has_data() const { return data_case() != DATA_NOT_SET; } -inline void PullBackupResponse::clear_has_data() { +inline void PullBackupResponse_InnerPullBackupResponse::clear_has_data() { _oneof_case_[0] = DATA_NOT_SET; } -inline PullBackupResponse::DataCase PullBackupResponse::data_case() const { - return PullBackupResponse::DataCase(_oneof_case_[0]); +inline PullBackupResponse_InnerPullBackupResponse::DataCase PullBackupResponse_InnerPullBackupResponse::data_case() const { + return PullBackupResponse_InnerPullBackupResponse::DataCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// PullBackupResponse + +// repeated .backup.PullBackupResponse.InnerPullBackupResponse inner = 1; +inline int PullBackupResponse::_internal_inner_size() const { + return inner_.size(); +} +inline int PullBackupResponse::inner_size() const { + return _internal_inner_size(); +} +inline void PullBackupResponse::clear_inner() { + inner_.Clear(); +} +inline ::backup::PullBackupResponse_InnerPullBackupResponse* PullBackupResponse::mutable_inner(int index) { + // @@protoc_insertion_point(field_mutable:backup.PullBackupResponse.inner) + return inner_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::backup::PullBackupResponse_InnerPullBackupResponse >* +PullBackupResponse::mutable_inner() { + // @@protoc_insertion_point(field_mutable_list:backup.PullBackupResponse.inner) + return &inner_; +} +inline const ::backup::PullBackupResponse_InnerPullBackupResponse& PullBackupResponse::_internal_inner(int index) const { + return inner_.Get(index); } +inline const ::backup::PullBackupResponse_InnerPullBackupResponse& PullBackupResponse::inner(int index) const { + // @@protoc_insertion_point(field_get:backup.PullBackupResponse.inner) + return _internal_inner(index); +} +inline ::backup::PullBackupResponse_InnerPullBackupResponse* PullBackupResponse::_internal_add_inner() { + return inner_.Add(); +} +inline ::backup::PullBackupResponse_InnerPullBackupResponse* PullBackupResponse::add_inner() { + // @@protoc_insertion_point(field_add:backup.PullBackupResponse.inner) + return _internal_add_inner(); +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::backup::PullBackupResponse_InnerPullBackupResponse >& +PullBackupResponse::inner() const { + // @@protoc_insertion_point(field_list:backup.PullBackupResponse.inner) + return inner_; +} + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ @@ -2828,6 +3157,8 @@ // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/native/cpp/CommonCpp/grpc/_generated/backup.pb.cc b/native/cpp/CommonCpp/grpc/_generated/backup.pb.cc --- a/native/cpp/CommonCpp/grpc/_generated/backup.pb.cc +++ b/native/cpp/CommonCpp/grpc/_generated/backup.pb.cc @@ -90,9 +90,21 @@ }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PullBackupRequestDefaultTypeInternal _PullBackupRequest_default_instance_; -constexpr PullBackupResponse::PullBackupResponse( +constexpr PullBackupResponse_InnerPullBackupResponse::PullBackupResponse_InnerPullBackupResponse( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) : _oneof_case_{}{} +struct PullBackupResponse_InnerPullBackupResponseDefaultTypeInternal { + constexpr PullBackupResponse_InnerPullBackupResponseDefaultTypeInternal() + : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + ~PullBackupResponse_InnerPullBackupResponseDefaultTypeInternal() {} + union { + PullBackupResponse_InnerPullBackupResponse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PullBackupResponse_InnerPullBackupResponseDefaultTypeInternal _PullBackupResponse_InnerPullBackupResponse_default_instance_; +constexpr PullBackupResponse::PullBackupResponse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) + : inner_(){} struct PullBackupResponseDefaultTypeInternal { constexpr PullBackupResponseDefaultTypeInternal() : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} @@ -103,7 +115,7 @@ }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PullBackupResponseDefaultTypeInternal _PullBackupResponse_default_instance_; } // namespace backup -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_backup_2eproto[7]; +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_backup_2eproto[8]; static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_backup_2eproto = nullptr; static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_backup_2eproto = nullptr; @@ -154,13 +166,20 @@ PROTOBUF_FIELD_OFFSET(::backup::PullBackupRequest, userid_), PROTOBUF_FIELD_OFFSET(::backup::PullBackupRequest, backupid_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::backup::PullBackupResponse, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::backup::PullBackupResponse_InnerPullBackupResponse, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::backup::PullBackupResponse, _oneof_case_[0]), + PROTOBUF_FIELD_OFFSET(::backup::PullBackupResponse_InnerPullBackupResponse, _oneof_case_[0]), ~0u, // no _weak_field_map_ ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, - PROTOBUF_FIELD_OFFSET(::backup::PullBackupResponse, data_), + ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::backup::PullBackupResponse_InnerPullBackupResponse, data_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::backup::PullBackupResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::backup::PullBackupResponse, inner_), }; static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, sizeof(::backup::CreateNewBackupRequest)}, @@ -169,7 +188,8 @@ { 26, -1, sizeof(::backup::RecoverBackupKeyRequest)}, { 32, -1, sizeof(::backup::RecoverBackupKeyResponse)}, { 38, -1, sizeof(::backup::PullBackupRequest)}, - { 45, -1, sizeof(::backup::PullBackupResponse)}, + { 45, -1, sizeof(::backup::PullBackupResponse_InnerPullBackupResponse)}, + { 54, -1, sizeof(::backup::PullBackupResponse)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { @@ -179,6 +199,7 @@ reinterpret_cast(&::backup::_RecoverBackupKeyRequest_default_instance_), reinterpret_cast(&::backup::_RecoverBackupKeyResponse_default_instance_), reinterpret_cast(&::backup::_PullBackupRequest_default_instance_), + reinterpret_cast(&::backup::_PullBackupResponse_InnerPullBackupResponse_default_instance_), reinterpret_cast(&::backup::_PullBackupResponse_default_instance_), }; @@ -194,26 +215,29 @@ "(\014H\000B\006\n\004data\")\n\027RecoverBackupKeyRequest\022" "\016\n\006userID\030\001 \001(\t\",\n\030RecoverBackupKeyRespo" "nse\022\020\n\010backupID\030\004 \001(\t\"5\n\021PullBackupReque" - "st\022\016\n\006userID\030\001 \001(\t\022\020\n\010backupID\030\002 \001(\t\"K\n\022" - "PullBackupResponse\022\031\n\017compactionChunk\030\001 " - "\001(\014H\000\022\022\n\010logChunk\030\002 \001(\014H\000B\006\n\004data2\316\002\n\rBa" - "ckupService\022X\n\017CreateNewBackup\022\036.backup." - "CreateNewBackupRequest\032\037.backup.CreateNe" - "wBackupResponse\"\000(\0010\001\022=\n\007SendLog\022\026.backu" - "p.SendLogRequest\032\026.google.protobuf.Empty" - "\"\000(\001\022[\n\020RecoverBackupKey\022\037.backup.Recove" - "rBackupKeyRequest\032 .backup.RecoverBackup" - "KeyResponse\"\000(\0010\001\022G\n\nPullBackup\022\031.backup" - ".PullBackupRequest\032\032.backup.PullBackupRe" - "sponse\"\0000\001b\006proto3" + "st\022\016\n\006userID\030\001 \001(\t\022\020\n\010backupID\030\002 \001(\t\"\305\001\n" + "\022PullBackupResponse\022A\n\005inner\030\001 \003(\01322.bac" + "kup.PullBackupResponse.InnerPullBackupRe" + "sponse\032l\n\027InnerPullBackupResponse\022\031\n\017com" + "pactionChunk\030\001 \001(\014H\000\022\032\n\020attachmentHolder" + "\030\002 \001(\tH\000\022\022\n\010logChunk\030\003 \001(\014H\000B\006\n\004data2\316\002\n" + "\rBackupService\022X\n\017CreateNewBackup\022\036.back" + "up.CreateNewBackupRequest\032\037.backup.Creat" + "eNewBackupResponse\"\000(\0010\001\022=\n\007SendLog\022\026.ba" + "ckup.SendLogRequest\032\026.google.protobuf.Em" + "pty\"\000(\001\022[\n\020RecoverBackupKey\022\037.backup.Rec" + "overBackupKeyRequest\032 .backup.RecoverBac" + "kupKeyResponse\"\000(\0010\001\022G\n\nPullBackup\022\031.bac" + "kup.PullBackupRequest\032\032.backup.PullBacku" + "pResponse\"\0000\001b\006proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_backup_2eproto_deps[1] = { &::descriptor_table_google_2fprotobuf_2fempty_2eproto, }; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_backup_2eproto_once; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_backup_2eproto = { - false, false, 898, descriptor_table_protodef_backup_2eproto, "backup.proto", - &descriptor_table_backup_2eproto_once, descriptor_table_backup_2eproto_deps, 1, 7, + false, false, 1021, descriptor_table_protodef_backup_2eproto, "backup.proto", + &descriptor_table_backup_2eproto_once, descriptor_table_backup_2eproto_deps, 1, 8, schemas, file_default_instances, TableStruct_backup_2eproto::offsets, file_level_metadata_backup_2eproto, file_level_enum_descriptors_backup_2eproto, file_level_service_descriptors_backup_2eproto, }; @@ -1738,17 +1762,17 @@ // =================================================================== -class PullBackupResponse::_Internal { +class PullBackupResponse_InnerPullBackupResponse::_Internal { public: }; -PullBackupResponse::PullBackupResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena) +PullBackupResponse_InnerPullBackupResponse::PullBackupResponse_InnerPullBackupResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena) : ::PROTOBUF_NAMESPACE_ID::Message(arena) { SharedCtor(); RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:backup.PullBackupResponse) + // @@protoc_insertion_point(arena_constructor:backup.PullBackupResponse.InnerPullBackupResponse) } -PullBackupResponse::PullBackupResponse(const PullBackupResponse& from) +PullBackupResponse_InnerPullBackupResponse::PullBackupResponse_InnerPullBackupResponse(const PullBackupResponse_InnerPullBackupResponse& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); clear_has_data(); @@ -1757,6 +1781,10 @@ _internal_set_compactionchunk(from._internal_compactionchunk()); break; } + case kAttachmentHolder: { + _internal_set_attachmentholder(from._internal_attachmentholder()); + break; + } case kLogChunk: { _internal_set_logchunk(from._internal_logchunk()); break; @@ -1765,43 +1793,47 @@ break; } } - // @@protoc_insertion_point(copy_constructor:backup.PullBackupResponse) + // @@protoc_insertion_point(copy_constructor:backup.PullBackupResponse.InnerPullBackupResponse) } -void PullBackupResponse::SharedCtor() { +void PullBackupResponse_InnerPullBackupResponse::SharedCtor() { clear_has_data(); } -PullBackupResponse::~PullBackupResponse() { - // @@protoc_insertion_point(destructor:backup.PullBackupResponse) +PullBackupResponse_InnerPullBackupResponse::~PullBackupResponse_InnerPullBackupResponse() { + // @@protoc_insertion_point(destructor:backup.PullBackupResponse.InnerPullBackupResponse) SharedDtor(); _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -void PullBackupResponse::SharedDtor() { +void PullBackupResponse_InnerPullBackupResponse::SharedDtor() { GOOGLE_DCHECK(GetArena() == nullptr); if (has_data()) { clear_data(); } } -void PullBackupResponse::ArenaDtor(void* object) { - PullBackupResponse* _this = reinterpret_cast< PullBackupResponse* >(object); +void PullBackupResponse_InnerPullBackupResponse::ArenaDtor(void* object) { + PullBackupResponse_InnerPullBackupResponse* _this = reinterpret_cast< PullBackupResponse_InnerPullBackupResponse* >(object); (void)_this; } -void PullBackupResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +void PullBackupResponse_InnerPullBackupResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { } -void PullBackupResponse::SetCachedSize(int size) const { +void PullBackupResponse_InnerPullBackupResponse::SetCachedSize(int size) const { _cached_size_.Set(size); } -void PullBackupResponse::clear_data() { -// @@protoc_insertion_point(one_of_clear_start:backup.PullBackupResponse) +void PullBackupResponse_InnerPullBackupResponse::clear_data() { +// @@protoc_insertion_point(one_of_clear_start:backup.PullBackupResponse.InnerPullBackupResponse) switch (data_case()) { case kCompactionChunk: { data_.compactionchunk_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); break; } + case kAttachmentHolder: { + data_.attachmentholder_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); + break; + } case kLogChunk: { data_.logchunk_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); break; @@ -1814,8 +1846,8 @@ } -void PullBackupResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:backup.PullBackupResponse) +void PullBackupResponse_InnerPullBackupResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:backup.PullBackupResponse.InnerPullBackupResponse) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -1824,7 +1856,7 @@ _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* PullBackupResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* PullBackupResponse_InnerPullBackupResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { ::PROTOBUF_NAMESPACE_ID::uint32 tag; @@ -1839,9 +1871,18 @@ CHK_(ptr); } else goto handle_unusual; continue; - // bytes logChunk = 2; + // string attachmentHolder = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + auto str = _internal_mutable_attachmentholder(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "backup.PullBackupResponse.InnerPullBackupResponse.attachmentHolder")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // bytes logChunk = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { auto str = _internal_mutable_logchunk(); ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); @@ -1869,9 +1910,9 @@ #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* PullBackupResponse::_InternalSerialize( +::PROTOBUF_NAMESPACE_ID::uint8* PullBackupResponse_InnerPullBackupResponse::_InternalSerialize( ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:backup.PullBackupResponse) + // @@protoc_insertion_point(serialize_to_array_start:backup.PullBackupResponse.InnerPullBackupResponse) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -1881,22 +1922,32 @@ 1, this->_internal_compactionchunk(), target); } - // bytes logChunk = 2; + // string attachmentHolder = 2; + if (_internal_has_attachmentholder()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_attachmentholder().data(), static_cast(this->_internal_attachmentholder().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "backup.PullBackupResponse.InnerPullBackupResponse.attachmentHolder"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_attachmentholder(), target); + } + + // bytes logChunk = 3; if (_internal_has_logchunk()) { target = stream->WriteBytesMaybeAliased( - 2, this->_internal_logchunk(), target); + 3, this->_internal_logchunk(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::PROTOBUF_NAMESPACE_ID::internal::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:backup.PullBackupResponse) + // @@protoc_insertion_point(serialize_to_array_end:backup.PullBackupResponse.InnerPullBackupResponse) return target; } -size_t PullBackupResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:backup.PullBackupResponse) +size_t PullBackupResponse_InnerPullBackupResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:backup.PullBackupResponse.InnerPullBackupResponse) size_t total_size = 0; ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; @@ -1911,7 +1962,14 @@ this->_internal_compactionchunk()); break; } - // bytes logChunk = 2; + // string attachmentHolder = 2; + case kAttachmentHolder: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_attachmentholder()); + break; + } + // bytes logChunk = 3; case kLogChunk: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( @@ -1931,23 +1989,23 @@ return total_size; } -void PullBackupResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:backup.PullBackupResponse) +void PullBackupResponse_InnerPullBackupResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:backup.PullBackupResponse.InnerPullBackupResponse) GOOGLE_DCHECK_NE(&from, this); - const PullBackupResponse* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + const PullBackupResponse_InnerPullBackupResponse* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( &from); if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:backup.PullBackupResponse) + // @@protoc_insertion_point(generalized_merge_from_cast_fail:backup.PullBackupResponse.InnerPullBackupResponse) ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:backup.PullBackupResponse) + // @@protoc_insertion_point(generalized_merge_from_cast_success:backup.PullBackupResponse.InnerPullBackupResponse) MergeFrom(*source); } } -void PullBackupResponse::MergeFrom(const PullBackupResponse& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:backup.PullBackupResponse) +void PullBackupResponse_InnerPullBackupResponse::MergeFrom(const PullBackupResponse_InnerPullBackupResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:backup.PullBackupResponse.InnerPullBackupResponse) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; @@ -1958,6 +2016,10 @@ _internal_set_compactionchunk(from._internal_compactionchunk()); break; } + case kAttachmentHolder: { + _internal_set_attachmentholder(from._internal_attachmentholder()); + break; + } case kLogChunk: { _internal_set_logchunk(from._internal_logchunk()); break; @@ -1968,6 +2030,201 @@ } } +void PullBackupResponse_InnerPullBackupResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:backup.PullBackupResponse.InnerPullBackupResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PullBackupResponse_InnerPullBackupResponse::CopyFrom(const PullBackupResponse_InnerPullBackupResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:backup.PullBackupResponse.InnerPullBackupResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PullBackupResponse_InnerPullBackupResponse::IsInitialized() const { + return true; +} + +void PullBackupResponse_InnerPullBackupResponse::InternalSwap(PullBackupResponse_InnerPullBackupResponse* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + swap(data_, other->data_); + swap(_oneof_case_[0], other->_oneof_case_[0]); +} + +::PROTOBUF_NAMESPACE_ID::Metadata PullBackupResponse_InnerPullBackupResponse::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +class PullBackupResponse::_Internal { + public: +}; + +PullBackupResponse::PullBackupResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena), + inner_(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:backup.PullBackupResponse) +} +PullBackupResponse::PullBackupResponse(const PullBackupResponse& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + inner_(from.inner_) { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:backup.PullBackupResponse) +} + +void PullBackupResponse::SharedCtor() { +} + +PullBackupResponse::~PullBackupResponse() { + // @@protoc_insertion_point(destructor:backup.PullBackupResponse) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void PullBackupResponse::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); +} + +void PullBackupResponse::ArenaDtor(void* object) { + PullBackupResponse* _this = reinterpret_cast< PullBackupResponse* >(object); + (void)_this; +} +void PullBackupResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void PullBackupResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void PullBackupResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:backup.PullBackupResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + inner_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* PullBackupResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // repeated .backup.PullBackupResponse.InnerPullBackupResponse inner = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_inner(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* PullBackupResponse::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:backup.PullBackupResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .backup.PullBackupResponse.InnerPullBackupResponse inner = 1; + for (unsigned int i = 0, + n = static_cast(this->_internal_inner_size()); i < n; i++) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, this->_internal_inner(i), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::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:backup.PullBackupResponse) + return target; +} + +size_t PullBackupResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:backup.PullBackupResponse) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .backup.PullBackupResponse.InnerPullBackupResponse inner = 1; + total_size += 1UL * this->_internal_inner_size(); + for (const auto& msg : this->inner_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void PullBackupResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:backup.PullBackupResponse) + GOOGLE_DCHECK_NE(&from, this); + const PullBackupResponse* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:backup.PullBackupResponse) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:backup.PullBackupResponse) + MergeFrom(*source); + } +} + +void PullBackupResponse::MergeFrom(const PullBackupResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:backup.PullBackupResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + inner_.MergeFrom(from.inner_); +} + void PullBackupResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:backup.PullBackupResponse) if (&from == this) return; @@ -1989,8 +2246,7 @@ void PullBackupResponse::InternalSwap(PullBackupResponse* other) { using std::swap; _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - swap(data_, other->data_); - swap(_oneof_case_[0], other->_oneof_case_[0]); + inner_.InternalSwap(&other->inner_); } ::PROTOBUF_NAMESPACE_ID::Metadata PullBackupResponse::GetMetadata() const { @@ -2019,6 +2275,9 @@ template<> PROTOBUF_NOINLINE ::backup::PullBackupRequest* Arena::CreateMaybeMessage< ::backup::PullBackupRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::backup::PullBackupRequest >(arena); } +template<> PROTOBUF_NOINLINE ::backup::PullBackupResponse_InnerPullBackupResponse* Arena::CreateMaybeMessage< ::backup::PullBackupResponse_InnerPullBackupResponse >(Arena* arena) { + return Arena::CreateMessageInternal< ::backup::PullBackupResponse_InnerPullBackupResponse >(arena); +} template<> PROTOBUF_NOINLINE ::backup::PullBackupResponse* Arena::CreateMaybeMessage< ::backup::PullBackupResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::backup::PullBackupResponse >(arena); } diff --git a/native/cpp/CommonCpp/grpc/protos/backup.proto b/native/cpp/CommonCpp/grpc/protos/backup.proto --- a/native/cpp/CommonCpp/grpc/protos/backup.proto +++ b/native/cpp/CommonCpp/grpc/protos/backup.proto @@ -69,8 +69,14 @@ } message PullBackupResponse { - oneof data { - bytes compactionChunk = 1; - bytes logChunk = 2; + // repeated is only needed for attachmentHolders + repeated InnerPullBackupResponse inner = 1; + + message InnerPullBackupResponse { + oneof data { + bytes compactionChunk = 1; + string attachmentHolders = 2; + bytes logChunk = 3; + } } } diff --git a/services/backup/src/Reactors/server/CreateNewBackupReactor.cpp b/services/backup/src/Reactors/server/CreateNewBackupReactor.cpp --- a/services/backup/src/Reactors/server/CreateNewBackupReactor.cpp +++ b/services/backup/src/Reactors/server/CreateNewBackupReactor.cpp @@ -84,7 +84,7 @@ getCurrentTimestamp(), generateRandomString(), this->holder, - {}); + {"aaa", "bbb", "cc"}); database::DatabaseManager::getInstance().putBackupItem(backupItem); } catch (std::runtime_error &e) { std::cout << "db operations error: " << e.what() << std::endl; diff --git a/services/backup/src/Reactors/server/PullBackupReactor.h b/services/backup/src/Reactors/server/PullBackupReactor.h --- a/services/backup/src/Reactors/server/PullBackupReactor.h +++ b/services/backup/src/Reactors/server/PullBackupReactor.h @@ -25,7 +25,8 @@ enum class State { COMPACTION = 1, - LOGS = 2, + ATTACHMENT_HOLDERS = 2, + LOGS = 3, }; std::shared_ptr backupItem; diff --git a/services/backup/src/Reactors/server/PullBackupReactor.cpp b/services/backup/src/Reactors/server/PullBackupReactor.cpp --- a/services/backup/src/Reactors/server/PullBackupReactor.cpp +++ b/services/backup/src/Reactors/server/PullBackupReactor.cpp @@ -60,7 +60,7 @@ std::string dataChunk; this->dataChunks->blockingRead(dataChunk); if (!dataChunk.empty()) { - response->set_compactionchunk(dataChunk); + response->add_inner()->set_compactionchunk(dataChunk); return nullptr; } if (!this->dataChunks->isEmpty()) { @@ -70,7 +70,20 @@ if (!this->getReactor->getStatus().ok()) { throw std::runtime_error(this->getReactor->getStatus().error_message()); } + this->state = State::ATTACHMENT_HOLDERS; + } + if (this->state == State::ATTACHMENT_HOLDERS) { + if (this->backupItem->getAttachmentHolders().empty()) { + this->state = State::LOGS; + return nullptr; + } + for (size_t i = 0; i < this->backupItem->getAttachmentHolders().size(); + ++i) { + response->add_inner()->set_attachmentholders( + this->backupItem->getAttachmentHolders().at(i)); + } this->state = State::LOGS; + return nullptr; } if (this->state == State::LOGS) { // TODO make sure logs are received in correct order regardless their size @@ -106,7 +119,7 @@ // if the item is persisted in the database, we just take it, send the // data to the client and reset currentLog so the next invocation of // writeResponse will take another one from the collection - response->set_logchunk(this->currentLog->getValue()); + response->add_inner()->set_logchunk(this->currentLog->getValue()); ++this->currentLogIndex; this->currentLog = nullptr; return nullptr; @@ -127,7 +140,7 @@ this->currentLog = nullptr; return nullptr; } else { - response->set_logchunk(dataChunk); + response->add_inner()->set_logchunk(dataChunk); } return nullptr; }