Page MenuHomePhabricator

D3627.id11386.diff
No OneTemporary

D3627.id11386.diff

diff --git a/native/cpp/CommonCpp/grpc/_generated/backup.grpc.pb.h b/native/cpp/CommonCpp/grpc/_generated/backup.grpc.pb.h
--- a/native/cpp/CommonCpp/grpc/_generated/backup.grpc.pb.h
+++ b/native/cpp/CommonCpp/grpc/_generated/backup.grpc.pb.h
@@ -75,14 +75,14 @@
std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>> PrepareAsyncRecoverBackupKey(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>>(PrepareAsyncRecoverBackupKeyRaw(context, cq));
}
- std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>> PullBackup(::grpc::ClientContext* context) {
- return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>>(PullBackupRaw(context));
+ std::unique_ptr< ::grpc::ClientReaderInterface< ::backup::PullBackupResponse>> PullBackup(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request) {
+ return std::unique_ptr< ::grpc::ClientReaderInterface< ::backup::PullBackupResponse>>(PullBackupRaw(context, request));
}
- std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>> AsyncPullBackup(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) {
- return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>>(AsyncPullBackupRaw(context, cq, tag));
+ std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::backup::PullBackupResponse>> AsyncPullBackup(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request, ::grpc::CompletionQueue* cq, void* tag) {
+ return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::backup::PullBackupResponse>>(AsyncPullBackupRaw(context, request, cq, tag));
}
- std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>> PrepareAsyncPullBackup(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) {
- return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>>(PrepareAsyncPullBackupRaw(context, cq));
+ std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::backup::PullBackupResponse>> PrepareAsyncPullBackup(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request, ::grpc::CompletionQueue* cq) {
+ return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::backup::PullBackupResponse>>(PrepareAsyncPullBackupRaw(context, request, cq));
}
class async_interface {
public:
@@ -90,7 +90,7 @@
virtual void CreateNewBackup(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::CreateNewBackupRequest,::backup::CreateNewBackupResponse>* reactor) = 0;
virtual void SendLog(::grpc::ClientContext* context, ::google::protobuf::Empty* response, ::grpc::ClientWriteReactor< ::backup::SendLogRequest>* reactor) = 0;
virtual void RecoverBackupKey(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::RecoverBackupKeyRequest,::backup::RecoverBackupKeyResponse>* reactor) = 0;
- virtual void PullBackup(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::PullBackupRequest,::backup::PullBackupResponse>* reactor) = 0;
+ virtual void PullBackup(::grpc::ClientContext* context, const ::backup::PullBackupRequest* request, ::grpc::ClientReadReactor< ::backup::PullBackupResponse>* reactor) = 0;
};
typedef class async_interface experimental_async_interface;
virtual class async_interface* async() { return nullptr; }
@@ -105,9 +105,9 @@
virtual ::grpc::ClientReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* RecoverBackupKeyRaw(::grpc::ClientContext* context) = 0;
virtual ::grpc::ClientAsyncReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* AsyncRecoverBackupKeyRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0;
virtual ::grpc::ClientAsyncReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* PrepareAsyncRecoverBackupKeyRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) = 0;
- virtual ::grpc::ClientReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* PullBackupRaw(::grpc::ClientContext* context) = 0;
- virtual ::grpc::ClientAsyncReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* AsyncPullBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0;
- virtual ::grpc::ClientAsyncReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* PrepareAsyncPullBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) = 0;
+ virtual ::grpc::ClientReaderInterface< ::backup::PullBackupResponse>* PullBackupRaw(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request) = 0;
+ virtual ::grpc::ClientAsyncReaderInterface< ::backup::PullBackupResponse>* AsyncPullBackupRaw(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request, ::grpc::CompletionQueue* cq, void* tag) = 0;
+ virtual ::grpc::ClientAsyncReaderInterface< ::backup::PullBackupResponse>* PrepareAsyncPullBackupRaw(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request, ::grpc::CompletionQueue* cq) = 0;
};
class Stub final : public StubInterface {
public:
@@ -139,14 +139,14 @@
std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>> PrepareAsyncRecoverBackupKey(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>>(PrepareAsyncRecoverBackupKeyRaw(context, cq));
}
- std::unique_ptr< ::grpc::ClientReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>> PullBackup(::grpc::ClientContext* context) {
- return std::unique_ptr< ::grpc::ClientReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>>(PullBackupRaw(context));
+ std::unique_ptr< ::grpc::ClientReader< ::backup::PullBackupResponse>> PullBackup(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request) {
+ return std::unique_ptr< ::grpc::ClientReader< ::backup::PullBackupResponse>>(PullBackupRaw(context, request));
}
- std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>> AsyncPullBackup(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) {
- return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>>(AsyncPullBackupRaw(context, cq, tag));
+ std::unique_ptr< ::grpc::ClientAsyncReader< ::backup::PullBackupResponse>> AsyncPullBackup(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request, ::grpc::CompletionQueue* cq, void* tag) {
+ return std::unique_ptr< ::grpc::ClientAsyncReader< ::backup::PullBackupResponse>>(AsyncPullBackupRaw(context, request, cq, tag));
}
- std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>> PrepareAsyncPullBackup(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) {
- return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>>(PrepareAsyncPullBackupRaw(context, cq));
+ std::unique_ptr< ::grpc::ClientAsyncReader< ::backup::PullBackupResponse>> PrepareAsyncPullBackup(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request, ::grpc::CompletionQueue* cq) {
+ return std::unique_ptr< ::grpc::ClientAsyncReader< ::backup::PullBackupResponse>>(PrepareAsyncPullBackupRaw(context, request, cq));
}
class async final :
public StubInterface::async_interface {
@@ -154,7 +154,7 @@
void CreateNewBackup(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::CreateNewBackupRequest,::backup::CreateNewBackupResponse>* reactor) override;
void SendLog(::grpc::ClientContext* context, ::google::protobuf::Empty* response, ::grpc::ClientWriteReactor< ::backup::SendLogRequest>* reactor) override;
void RecoverBackupKey(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::RecoverBackupKeyRequest,::backup::RecoverBackupKeyResponse>* reactor) override;
- void PullBackup(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::PullBackupRequest,::backup::PullBackupResponse>* reactor) override;
+ void PullBackup(::grpc::ClientContext* context, const ::backup::PullBackupRequest* request, ::grpc::ClientReadReactor< ::backup::PullBackupResponse>* reactor) override;
private:
friend class Stub;
explicit async(Stub* stub): stub_(stub) { }
@@ -175,9 +175,9 @@
::grpc::ClientReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* RecoverBackupKeyRaw(::grpc::ClientContext* context) override;
::grpc::ClientAsyncReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* AsyncRecoverBackupKeyRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override;
::grpc::ClientAsyncReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* PrepareAsyncRecoverBackupKeyRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override;
- ::grpc::ClientReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* PullBackupRaw(::grpc::ClientContext* context) override;
- ::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* AsyncPullBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override;
- ::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* PrepareAsyncPullBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override;
+ ::grpc::ClientReader< ::backup::PullBackupResponse>* PullBackupRaw(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request) override;
+ ::grpc::ClientAsyncReader< ::backup::PullBackupResponse>* AsyncPullBackupRaw(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request, ::grpc::CompletionQueue* cq, void* tag) override;
+ ::grpc::ClientAsyncReader< ::backup::PullBackupResponse>* PrepareAsyncPullBackupRaw(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request, ::grpc::CompletionQueue* cq) override;
const ::grpc::internal::RpcMethod rpcmethod_CreateNewBackup_;
const ::grpc::internal::RpcMethod rpcmethod_SendLog_;
const ::grpc::internal::RpcMethod rpcmethod_RecoverBackupKey_;
@@ -192,7 +192,7 @@
virtual ::grpc::Status CreateNewBackup(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::backup::CreateNewBackupResponse, ::backup::CreateNewBackupRequest>* stream);
virtual ::grpc::Status SendLog(::grpc::ServerContext* context, ::grpc::ServerReader< ::backup::SendLogRequest>* reader, ::google::protobuf::Empty* response);
virtual ::grpc::Status RecoverBackupKey(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::backup::RecoverBackupKeyResponse, ::backup::RecoverBackupKeyRequest>* stream);
- virtual ::grpc::Status PullBackup(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* stream);
+ virtual ::grpc::Status PullBackup(::grpc::ServerContext* context, const ::backup::PullBackupRequest* request, ::grpc::ServerWriter< ::backup::PullBackupResponse>* writer);
};
template <class BaseClass>
class WithAsyncMethod_CreateNewBackup : public BaseClass {
@@ -266,12 +266,12 @@
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
- ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* /*stream*/) override {
+ ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, const ::backup::PullBackupRequest* /*request*/, ::grpc::ServerWriter< ::backup::PullBackupResponse>* /*writer*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
- void RequestPullBackup(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
- ::grpc::Service::RequestAsyncBidiStreaming(3, context, stream, new_call_cq, notification_cq, tag);
+ void RequestPullBackup(::grpc::ServerContext* context, ::backup::PullBackupRequest* request, ::grpc::ServerAsyncWriter< ::backup::PullBackupResponse>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
+ ::grpc::Service::RequestAsyncServerStreaming(3, context, request, writer, new_call_cq, notification_cq, tag);
}
};
typedef WithAsyncMethod_CreateNewBackup<WithAsyncMethod_SendLog<WithAsyncMethod_RecoverBackupKey<WithAsyncMethod_PullBackup<Service > > > > AsyncService;
@@ -350,21 +350,20 @@
public:
WithCallbackMethod_PullBackup() {
::grpc::Service::MarkMethodCallback(3,
- new ::grpc::internal::CallbackBidiHandler< ::backup::PullBackupRequest, ::backup::PullBackupResponse>(
+ new ::grpc::internal::CallbackServerStreamingHandler< ::backup::PullBackupRequest, ::backup::PullBackupResponse>(
[this](
- ::grpc::CallbackServerContext* context) { return this->PullBackup(context); }));
+ ::grpc::CallbackServerContext* context, const ::backup::PullBackupRequest* request) { return this->PullBackup(context, request); }));
}
~WithCallbackMethod_PullBackup() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
- ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* /*stream*/) override {
+ ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, const ::backup::PullBackupRequest* /*request*/, ::grpc::ServerWriter< ::backup::PullBackupResponse>* /*writer*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
- virtual ::grpc::ServerBidiReactor< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* PullBackup(
- ::grpc::CallbackServerContext* /*context*/)
- { return nullptr; }
+ virtual ::grpc::ServerWriteReactor< ::backup::PullBackupResponse>* PullBackup(
+ ::grpc::CallbackServerContext* /*context*/, const ::backup::PullBackupRequest* /*request*/) { return nullptr; }
};
typedef WithCallbackMethod_CreateNewBackup<WithCallbackMethod_SendLog<WithCallbackMethod_RecoverBackupKey<WithCallbackMethod_PullBackup<Service > > > > CallbackService;
typedef CallbackService ExperimentalCallbackService;
@@ -431,7 +430,7 @@
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
- ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* /*stream*/) override {
+ ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, const ::backup::PullBackupRequest* /*request*/, ::grpc::ServerWriter< ::backup::PullBackupResponse>* /*writer*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
@@ -508,12 +507,12 @@
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
- ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* /*stream*/) override {
+ ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, const ::backup::PullBackupRequest* /*request*/, ::grpc::ServerWriter< ::backup::PullBackupResponse>* /*writer*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
- void RequestPullBackup(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
- ::grpc::Service::RequestAsyncBidiStreaming(3, context, stream, new_call_cq, notification_cq, tag);
+ void RequestPullBackup(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
+ ::grpc::Service::RequestAsyncServerStreaming(3, context, request, writer, new_call_cq, notification_cq, tag);
}
};
template <class BaseClass>
@@ -591,25 +590,51 @@
public:
WithRawCallbackMethod_PullBackup() {
::grpc::Service::MarkMethodRawCallback(3,
- new ::grpc::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>(
+ new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>(
[this](
- ::grpc::CallbackServerContext* context) { return this->PullBackup(context); }));
+ ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->PullBackup(context, request); }));
}
~WithRawCallbackMethod_PullBackup() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
- ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* /*stream*/) override {
+ ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, const ::backup::PullBackupRequest* /*request*/, ::grpc::ServerWriter< ::backup::PullBackupResponse>* /*writer*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
- virtual ::grpc::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* PullBackup(
- ::grpc::CallbackServerContext* /*context*/)
- { return nullptr; }
+ virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* PullBackup(
+ ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) { return nullptr; }
};
typedef Service StreamedUnaryService;
- typedef Service SplitStreamedService;
- typedef Service StreamedService;
+ template <class BaseClass>
+ class WithSplitStreamingMethod_PullBackup : public BaseClass {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+ public:
+ WithSplitStreamingMethod_PullBackup() {
+ ::grpc::Service::MarkMethodStreamed(3,
+ new ::grpc::internal::SplitServerStreamingHandler<
+ ::backup::PullBackupRequest, ::backup::PullBackupResponse>(
+ [this](::grpc::ServerContext* context,
+ ::grpc::ServerSplitStreamer<
+ ::backup::PullBackupRequest, ::backup::PullBackupResponse>* streamer) {
+ return this->StreamedPullBackup(context,
+ streamer);
+ }));
+ }
+ ~WithSplitStreamingMethod_PullBackup() override {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable regular version of this method
+ ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, const ::backup::PullBackupRequest* /*request*/, ::grpc::ServerWriter< ::backup::PullBackupResponse>* /*writer*/) override {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ // replace default version of method with split streamed
+ virtual ::grpc::Status StreamedPullBackup(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::backup::PullBackupRequest,::backup::PullBackupResponse>* server_split_streamer) = 0;
+ };
+ typedef WithSplitStreamingMethod_PullBackup<Service > SplitStreamedService;
+ typedef WithSplitStreamingMethod_PullBackup<Service > StreamedService;
};
} // namespace backup
diff --git a/native/cpp/CommonCpp/grpc/_generated/backup.grpc.pb.cc b/native/cpp/CommonCpp/grpc/_generated/backup.grpc.pb.cc
--- a/native/cpp/CommonCpp/grpc/_generated/backup.grpc.pb.cc
+++ b/native/cpp/CommonCpp/grpc/_generated/backup.grpc.pb.cc
@@ -38,7 +38,7 @@
: channel_(channel), rpcmethod_CreateNewBackup_(BackupService_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::BIDI_STREAMING, channel)
, rpcmethod_SendLog_(BackupService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::CLIENT_STREAMING, channel)
, rpcmethod_RecoverBackupKey_(BackupService_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::BIDI_STREAMING, channel)
- , rpcmethod_PullBackup_(BackupService_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::BIDI_STREAMING, channel)
+ , rpcmethod_PullBackup_(BackupService_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
{}
::grpc::ClientReaderWriter< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>* BackupService::Stub::CreateNewBackupRaw(::grpc::ClientContext* context) {
@@ -89,20 +89,20 @@
return ::grpc::internal::ClientAsyncReaderWriterFactory< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>::Create(channel_.get(), cq, rpcmethod_RecoverBackupKey_, context, false, nullptr);
}
-::grpc::ClientReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* BackupService::Stub::PullBackupRaw(::grpc::ClientContext* context) {
- return ::grpc::internal::ClientReaderWriterFactory< ::backup::PullBackupRequest, ::backup::PullBackupResponse>::Create(channel_.get(), rpcmethod_PullBackup_, context);
+::grpc::ClientReader< ::backup::PullBackupResponse>* BackupService::Stub::PullBackupRaw(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request) {
+ return ::grpc::internal::ClientReaderFactory< ::backup::PullBackupResponse>::Create(channel_.get(), rpcmethod_PullBackup_, context, request);
}
-void BackupService::Stub::async::PullBackup(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::PullBackupRequest,::backup::PullBackupResponse>* reactor) {
- ::grpc::internal::ClientCallbackReaderWriterFactory< ::backup::PullBackupRequest,::backup::PullBackupResponse>::Create(stub_->channel_.get(), stub_->rpcmethod_PullBackup_, context, reactor);
+void BackupService::Stub::async::PullBackup(::grpc::ClientContext* context, const ::backup::PullBackupRequest* request, ::grpc::ClientReadReactor< ::backup::PullBackupResponse>* reactor) {
+ ::grpc::internal::ClientCallbackReaderFactory< ::backup::PullBackupResponse>::Create(stub_->channel_.get(), stub_->rpcmethod_PullBackup_, context, request, reactor);
}
-::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* BackupService::Stub::AsyncPullBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) {
- return ::grpc::internal::ClientAsyncReaderWriterFactory< ::backup::PullBackupRequest, ::backup::PullBackupResponse>::Create(channel_.get(), cq, rpcmethod_PullBackup_, context, true, tag);
+::grpc::ClientAsyncReader< ::backup::PullBackupResponse>* BackupService::Stub::AsyncPullBackupRaw(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request, ::grpc::CompletionQueue* cq, void* tag) {
+ return ::grpc::internal::ClientAsyncReaderFactory< ::backup::PullBackupResponse>::Create(channel_.get(), cq, rpcmethod_PullBackup_, context, request, true, tag);
}
-::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* BackupService::Stub::PrepareAsyncPullBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) {
- return ::grpc::internal::ClientAsyncReaderWriterFactory< ::backup::PullBackupRequest, ::backup::PullBackupResponse>::Create(channel_.get(), cq, rpcmethod_PullBackup_, context, false, nullptr);
+::grpc::ClientAsyncReader< ::backup::PullBackupResponse>* BackupService::Stub::PrepareAsyncPullBackupRaw(::grpc::ClientContext* context, const ::backup::PullBackupRequest& request, ::grpc::CompletionQueue* cq) {
+ return ::grpc::internal::ClientAsyncReaderFactory< ::backup::PullBackupResponse>::Create(channel_.get(), cq, rpcmethod_PullBackup_, context, request, false, nullptr);
}
BackupService::Service::Service() {
@@ -138,13 +138,13 @@
}, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod(
BackupService_method_names[3],
- ::grpc::internal::RpcMethod::BIDI_STREAMING,
- new ::grpc::internal::BidiStreamingHandler< BackupService::Service, ::backup::PullBackupRequest, ::backup::PullBackupResponse>(
+ ::grpc::internal::RpcMethod::SERVER_STREAMING,
+ new ::grpc::internal::ServerStreamingHandler< BackupService::Service, ::backup::PullBackupRequest, ::backup::PullBackupResponse>(
[](BackupService::Service* service,
::grpc::ServerContext* ctx,
- ::grpc::ServerReaderWriter<::backup::PullBackupResponse,
- ::backup::PullBackupRequest>* stream) {
- return service->PullBackup(ctx, stream);
+ const ::backup::PullBackupRequest* req,
+ ::grpc::ServerWriter<::backup::PullBackupResponse>* writer) {
+ return service->PullBackup(ctx, req, writer);
}, this)));
}
@@ -170,9 +170,10 @@
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
-::grpc::Status BackupService::Service::PullBackup(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* stream) {
+::grpc::Status BackupService::Service::PullBackup(::grpc::ServerContext* context, const ::backup::PullBackupRequest* request, ::grpc::ServerWriter< ::backup::PullBackupResponse>* writer) {
(void) context;
- (void) stream;
+ (void) request;
+ (void) writer;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
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
@@ -891,11 +891,6 @@
static const RecoverBackupKeyResponse& default_instance() {
return *internal_default_instance();
}
- enum DataCase {
- kBackupID = 4,
- DATA_NOT_SET = 0,
- };
-
static inline const RecoverBackupKeyResponse* internal_default_instance() {
return reinterpret_cast<const RecoverBackupKeyResponse*>(
&_RecoverBackupKeyResponse_default_instance_);
@@ -974,10 +969,6 @@
kBackupIDFieldNumber = 4,
};
// string backupID = 4;
- bool has_backupid() const;
- private:
- bool _internal_has_backupid() const;
- public:
void clear_backupid();
const std::string& backupid() const;
void set_backupid(const std::string& value);
@@ -993,27 +984,15 @@
std::string* _internal_mutable_backupid();
public:
- void clear_data();
- DataCase data_case() const;
// @@protoc_insertion_point(class_scope:backup.RecoverBackupKeyResponse)
private:
class _Internal;
- void set_has_backupid();
-
- inline bool has_data() const;
- inline void clear_has_data();
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
- union DataUnion {
- constexpr DataUnion() : _constinit_{} {}
- ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr backupid_;
- } data_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr backupid_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
- ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1];
-
friend struct ::TableStruct_backup_2eproto;
};
// -------------------------------------------------------------------
@@ -1132,6 +1111,7 @@
enum : int {
kUserIDFieldNumber = 1,
+ kBackupIDFieldNumber = 2,
};
// string userID = 1;
void clear_userid();
@@ -1149,6 +1129,22 @@
std::string* _internal_mutable_userid();
public:
+ // string backupID = 2;
+ void clear_backupid();
+ const std::string& backupid() const;
+ void set_backupid(const std::string& value);
+ void set_backupid(std::string&& value);
+ void set_backupid(const char* value);
+ void set_backupid(const char* value, size_t size);
+ std::string* mutable_backupid();
+ std::string* release_backupid();
+ void set_allocated_backupid(std::string* backupid);
+ private:
+ const std::string& _internal_backupid() const;
+ void _internal_set_backupid(const std::string& value);
+ std::string* _internal_mutable_backupid();
+ public:
+
// @@protoc_insertion_point(class_scope:backup.PullBackupRequest)
private:
class _Internal;
@@ -1157,6 +1153,7 @@
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr userid_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr backupid_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_backup_2eproto;
};
@@ -2397,20 +2394,8 @@
// RecoverBackupKeyResponse
// string backupID = 4;
-inline bool RecoverBackupKeyResponse::_internal_has_backupid() const {
- return data_case() == kBackupID;
-}
-inline bool RecoverBackupKeyResponse::has_backupid() const {
- return _internal_has_backupid();
-}
-inline void RecoverBackupKeyResponse::set_has_backupid() {
- _oneof_case_[0] = kBackupID;
-}
inline void RecoverBackupKeyResponse::clear_backupid() {
- if (_internal_has_backupid()) {
- data_.backupid_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
- clear_has_data();
- }
+ backupid_.ClearToEmpty();
}
inline const std::string& RecoverBackupKeyResponse::backupid() const {
// @@protoc_insertion_point(field_get:backup.RecoverBackupKeyResponse.backupID)
@@ -2425,96 +2410,50 @@
return _internal_mutable_backupid();
}
inline const std::string& RecoverBackupKeyResponse::_internal_backupid() const {
- if (_internal_has_backupid()) {
- return data_.backupid_.Get();
- }
- return ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited();
+ return backupid_.Get();
}
inline void RecoverBackupKeyResponse::_internal_set_backupid(const std::string& value) {
- if (!_internal_has_backupid()) {
- clear_data();
- set_has_backupid();
- data_.backupid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- }
- data_.backupid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
+
+ backupid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
}
inline void RecoverBackupKeyResponse::set_backupid(std::string&& value) {
- // @@protoc_insertion_point(field_set:backup.RecoverBackupKeyResponse.backupID)
- if (!_internal_has_backupid()) {
- clear_data();
- set_has_backupid();
- data_.backupid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- }
- data_.backupid_.Set(
+
+ backupid_.Set(
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
// @@protoc_insertion_point(field_set_rvalue:backup.RecoverBackupKeyResponse.backupID)
}
inline void RecoverBackupKeyResponse::set_backupid(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- if (!_internal_has_backupid()) {
- clear_data();
- set_has_backupid();
- data_.backupid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- }
- data_.backupid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{},
- ::std::string(value), GetArena());
+
+ backupid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
// @@protoc_insertion_point(field_set_char:backup.RecoverBackupKeyResponse.backupID)
}
inline void RecoverBackupKeyResponse::set_backupid(const char* value,
- size_t size) {
- if (!_internal_has_backupid()) {
- clear_data();
- set_has_backupid();
- data_.backupid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- }
- data_.backupid_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size),
- GetArena());
+ size_t size) {
+
+ backupid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
+ reinterpret_cast<const char*>(value), size), GetArena());
// @@protoc_insertion_point(field_set_pointer:backup.RecoverBackupKeyResponse.backupID)
}
inline std::string* RecoverBackupKeyResponse::_internal_mutable_backupid() {
- if (!_internal_has_backupid()) {
- clear_data();
- set_has_backupid();
- data_.backupid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- }
- return data_.backupid_.Mutable(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+
+ return backupid_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
}
inline std::string* RecoverBackupKeyResponse::release_backupid() {
// @@protoc_insertion_point(field_release:backup.RecoverBackupKeyResponse.backupID)
- if (_internal_has_backupid()) {
- clear_has_data();
- return data_.backupid_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
- } else {
- return nullptr;
- }
+ return backupid_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline void RecoverBackupKeyResponse::set_allocated_backupid(std::string* backupid) {
- if (has_data()) {
- clear_data();
- }
if (backupid != nullptr) {
- set_has_backupid();
- data_.backupid_.UnsafeSetDefault(backupid);
- ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena();
- if (arena != nullptr) {
- arena->Own(backupid);
- }
+
+ } else {
+
}
+ backupid_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), backupid,
+ GetArena());
// @@protoc_insertion_point(field_set_allocated:backup.RecoverBackupKeyResponse.backupID)
}
-inline bool RecoverBackupKeyResponse::has_data() const {
- return data_case() != DATA_NOT_SET;
-}
-inline void RecoverBackupKeyResponse::clear_has_data() {
- _oneof_case_[0] = DATA_NOT_SET;
-}
-inline RecoverBackupKeyResponse::DataCase RecoverBackupKeyResponse::data_case() const {
- return RecoverBackupKeyResponse::DataCase(_oneof_case_[0]);
-}
// -------------------------------------------------------------------
// PullBackupRequest
@@ -2580,6 +2519,67 @@
// @@protoc_insertion_point(field_set_allocated:backup.PullBackupRequest.userID)
}
+// string backupID = 2;
+inline void PullBackupRequest::clear_backupid() {
+ backupid_.ClearToEmpty();
+}
+inline const std::string& PullBackupRequest::backupid() const {
+ // @@protoc_insertion_point(field_get:backup.PullBackupRequest.backupID)
+ return _internal_backupid();
+}
+inline void PullBackupRequest::set_backupid(const std::string& value) {
+ _internal_set_backupid(value);
+ // @@protoc_insertion_point(field_set:backup.PullBackupRequest.backupID)
+}
+inline std::string* PullBackupRequest::mutable_backupid() {
+ // @@protoc_insertion_point(field_mutable:backup.PullBackupRequest.backupID)
+ return _internal_mutable_backupid();
+}
+inline const std::string& PullBackupRequest::_internal_backupid() const {
+ return backupid_.Get();
+}
+inline void PullBackupRequest::_internal_set_backupid(const std::string& value) {
+
+ backupid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
+}
+inline void PullBackupRequest::set_backupid(std::string&& value) {
+
+ backupid_.Set(
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
+ // @@protoc_insertion_point(field_set_rvalue:backup.PullBackupRequest.backupID)
+}
+inline void PullBackupRequest::set_backupid(const char* value) {
+ GOOGLE_DCHECK(value != nullptr);
+
+ backupid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
+ // @@protoc_insertion_point(field_set_char:backup.PullBackupRequest.backupID)
+}
+inline void PullBackupRequest::set_backupid(const char* value,
+ size_t size) {
+
+ backupid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
+ reinterpret_cast<const char*>(value), size), GetArena());
+ // @@protoc_insertion_point(field_set_pointer:backup.PullBackupRequest.backupID)
+}
+inline std::string* PullBackupRequest::_internal_mutable_backupid() {
+
+ return backupid_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+}
+inline std::string* PullBackupRequest::release_backupid() {
+ // @@protoc_insertion_point(field_release:backup.PullBackupRequest.backupID)
+ return backupid_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+}
+inline void PullBackupRequest::set_allocated_backupid(std::string* backupid) {
+ if (backupid != nullptr) {
+
+ } else {
+
+ }
+ backupid_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), backupid,
+ GetArena());
+ // @@protoc_insertion_point(field_set_allocated:backup.PullBackupRequest.backupID)
+}
+
// -------------------------------------------------------------------
// PullBackupResponse
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
@@ -67,7 +67,7 @@
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT RecoverBackupKeyRequestDefaultTypeInternal _RecoverBackupKeyRequest_default_instance_;
constexpr RecoverBackupKeyResponse::RecoverBackupKeyResponse(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
- : _oneof_case_{}{}
+ : backupid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct RecoverBackupKeyResponseDefaultTypeInternal {
constexpr RecoverBackupKeyResponseDefaultTypeInternal()
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
@@ -79,7 +79,8 @@
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT RecoverBackupKeyResponseDefaultTypeInternal _RecoverBackupKeyResponse_default_instance_;
constexpr PullBackupRequest::PullBackupRequest(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
- : userid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
+ : userid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+ , backupid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct PullBackupRequestDefaultTypeInternal {
constexpr PullBackupRequestDefaultTypeInternal()
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
@@ -142,16 +143,16 @@
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::backup::RecoverBackupKeyResponse, _internal_metadata_),
~0u, // no _extensions_
- PROTOBUF_FIELD_OFFSET(::backup::RecoverBackupKeyResponse, _oneof_case_[0]),
+ ~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
- PROTOBUF_FIELD_OFFSET(::backup::RecoverBackupKeyResponse, data_),
+ PROTOBUF_FIELD_OFFSET(::backup::RecoverBackupKeyResponse, backupid_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::backup::PullBackupRequest, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::backup::PullBackupRequest, userid_),
+ PROTOBUF_FIELD_OFFSET(::backup::PullBackupRequest, backupid_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::backup::PullBackupResponse, _internal_metadata_),
~0u, // no _extensions_
@@ -167,7 +168,7 @@
{ 16, -1, sizeof(::backup::SendLogRequest)},
{ 26, -1, sizeof(::backup::RecoverBackupKeyRequest)},
{ 32, -1, sizeof(::backup::RecoverBackupKeyResponse)},
- { 39, -1, sizeof(::backup::PullBackupRequest)},
+ { 38, -1, sizeof(::backup::PullBackupRequest)},
{ 45, -1, sizeof(::backup::PullBackupResponse)},
};
@@ -191,27 +192,27 @@
"gRequest\022\020\n\006userID\030\001 \001(\tH\000\022\022\n\010backupID\030\002"
" \001(\tH\000\022\021\n\007logHash\030\003 \001(\014H\000\022\021\n\007logData\030\004 \001"
"(\014H\000B\006\n\004data\")\n\027RecoverBackupKeyRequest\022"
- "\016\n\006userID\030\001 \001(\t\"6\n\030RecoverBackupKeyRespo"
- "nse\022\022\n\010backupID\030\004 \001(\tH\000B\006\n\004data\"#\n\021PullB"
- "ackupRequest\022\016\n\006userID\030\001 \001(\t\"K\n\022PullBack"
- "upResponse\022\031\n\017compactionChunk\030\001 \001(\014H\000\022\022\n"
- "\010logChunk\030\002 \001(\014H\000B\006\n\004data2\320\002\n\rBackupServ"
- "ice\022X\n\017CreateNewBackup\022\036.backup.CreateNe"
- "wBackupRequest\032\037.backup.CreateNewBackupR"
- "esponse\"\000(\0010\001\022=\n\007SendLog\022\026.backup.SendLo"
- "gRequest\032\026.google.protobuf.Empty\"\000(\001\022[\n\020"
- "RecoverBackupKey\022\037.backup.RecoverBackupK"
- "eyRequest\032 .backup.RecoverBackupKeyRespo"
- "nse\"\000(\0010\001\022I\n\nPullBackup\022\031.backup.PullBac"
- "kupRequest\032\032.backup.PullBackupResponse\"\000"
- "(\0010\001b\006proto3"
+ "\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"
;
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, 892, descriptor_table_protodef_backup_2eproto, "backup.proto",
+ false, false, 898, descriptor_table_protodef_backup_2eproto, "backup.proto",
&descriptor_table_backup_2eproto_once, descriptor_table_backup_2eproto_deps, 1, 7,
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,
@@ -1312,21 +1313,16 @@
RecoverBackupKeyResponse::RecoverBackupKeyResponse(const RecoverBackupKeyResponse& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
- clear_has_data();
- switch (from.data_case()) {
- case kBackupID: {
- _internal_set_backupid(from._internal_backupid());
- break;
- }
- case DATA_NOT_SET: {
- break;
- }
+ backupid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ if (!from._internal_backupid().empty()) {
+ backupid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_backupid(),
+ GetArena());
}
// @@protoc_insertion_point(copy_constructor:backup.RecoverBackupKeyResponse)
}
void RecoverBackupKeyResponse::SharedCtor() {
-clear_has_data();
+backupid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
RecoverBackupKeyResponse::~RecoverBackupKeyResponse() {
@@ -1337,9 +1333,7 @@
void RecoverBackupKeyResponse::SharedDtor() {
GOOGLE_DCHECK(GetArena() == nullptr);
- if (has_data()) {
- clear_data();
- }
+ backupid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void RecoverBackupKeyResponse::ArenaDtor(void* object) {
@@ -1352,28 +1346,13 @@
_cached_size_.Set(size);
}
-void RecoverBackupKeyResponse::clear_data() {
-// @@protoc_insertion_point(one_of_clear_start:backup.RecoverBackupKeyResponse)
- switch (data_case()) {
- case kBackupID: {
- data_.backupid_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
- break;
- }
- case DATA_NOT_SET: {
- break;
- }
- }
- _oneof_case_[0] = DATA_NOT_SET;
-}
-
-
void RecoverBackupKeyResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:backup.RecoverBackupKeyResponse)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- clear_data();
+ backupid_.ClearToEmpty();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
@@ -1422,7 +1401,7 @@
(void) cached_has_bits;
// string backupID = 4;
- if (_internal_has_backupid()) {
+ if (this->backupid().size() > 0) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_backupid().data(), static_cast<int>(this->_internal_backupid().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
@@ -1447,18 +1426,13 @@
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- switch (data_case()) {
- // string backupID = 4;
- case kBackupID: {
- total_size += 1 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
- this->_internal_backupid());
- break;
- }
- case DATA_NOT_SET: {
- break;
- }
+ // string backupID = 4;
+ if (this->backupid().size() > 0) {
+ total_size += 1 +
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+ this->_internal_backupid());
}
+
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
@@ -1490,14 +1464,8 @@
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
- switch (from.data_case()) {
- case kBackupID: {
- _internal_set_backupid(from._internal_backupid());
- break;
- }
- case DATA_NOT_SET: {
- break;
- }
+ if (from.backupid().size() > 0) {
+ _internal_set_backupid(from._internal_backupid());
}
}
@@ -1522,8 +1490,7 @@
void RecoverBackupKeyResponse::InternalSwap(RecoverBackupKeyResponse* 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]);
+ backupid_.Swap(&other->backupid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
::PROTOBUF_NAMESPACE_ID::Metadata RecoverBackupKeyResponse::GetMetadata() const {
@@ -1551,11 +1518,17 @@
userid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_userid(),
GetArena());
}
+ backupid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ if (!from._internal_backupid().empty()) {
+ backupid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_backupid(),
+ GetArena());
+ }
// @@protoc_insertion_point(copy_constructor:backup.PullBackupRequest)
}
void PullBackupRequest::SharedCtor() {
userid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+backupid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
PullBackupRequest::~PullBackupRequest() {
@@ -1567,6 +1540,7 @@
void PullBackupRequest::SharedDtor() {
GOOGLE_DCHECK(GetArena() == nullptr);
userid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ backupid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void PullBackupRequest::ArenaDtor(void* object) {
@@ -1586,6 +1560,7 @@
(void) cached_has_bits;
userid_.ClearToEmpty();
+ backupid_.ClearToEmpty();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
@@ -1605,6 +1580,15 @@
CHK_(ptr);
} else goto handle_unusual;
continue;
+ // string backupID = 2;
+ case 2:
+ if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
+ auto str = _internal_mutable_backupid();
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "backup.PullBackupRequest.backupID"));
+ CHK_(ptr);
+ } else goto handle_unusual;
+ continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
@@ -1643,6 +1627,16 @@
1, this->_internal_userid(), target);
}
+ // string backupID = 2;
+ if (this->backupid().size() > 0) {
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+ this->_internal_backupid().data(), static_cast<int>(this->_internal_backupid().length()),
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
+ "backup.PullBackupRequest.backupID");
+ target = stream->WriteStringMaybeAliased(
+ 2, this->_internal_backupid(), 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);
@@ -1666,6 +1660,13 @@
this->_internal_userid());
}
+ // string backupID = 2;
+ if (this->backupid().size() > 0) {
+ total_size += 1 +
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+ this->_internal_backupid());
+ }
+
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
@@ -1700,6 +1701,9 @@
if (from.userid().size() > 0) {
_internal_set_userid(from._internal_userid());
}
+ if (from.backupid().size() > 0) {
+ _internal_set_backupid(from._internal_backupid());
+ }
}
void PullBackupRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
@@ -1724,6 +1728,7 @@
using std::swap;
_internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
userid_.Swap(&other->userid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ backupid_.Swap(&other->backupid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
::PROTOBUF_NAMESPACE_ID::Metadata PullBackupRequest::GetMetadata() const {
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
@@ -22,7 +22,7 @@
rpc CreateNewBackup(stream CreateNewBackupRequest) returns (stream CreateNewBackupResponse) {}
rpc SendLog(stream SendLogRequest) returns (google.protobuf.Empty) {}
rpc RecoverBackupKey(stream RecoverBackupKeyRequest) returns (stream RecoverBackupKeyResponse) {}
- rpc PullBackup(stream PullBackupRequest) returns (stream PullBackupResponse) {}
+ rpc PullBackup(PullBackupRequest) returns (stream PullBackupResponse) {}
}
// CreateNewBackup
@@ -58,15 +58,14 @@
}
message RecoverBackupKeyResponse {
- oneof data {
- string backupID = 4;
- }
+ string backupID = 4;
}
// PullBackup
message PullBackupRequest {
string userID = 1;
+ string backupID = 2;
}
message PullBackupResponse {
diff --git a/services/backup/docker-server/contents/server/src/BackupServiceImpl.h b/services/backup/docker-server/contents/server/src/BackupServiceImpl.h
--- a/services/backup/docker-server/contents/server/src/BackupServiceImpl.h
+++ b/services/backup/docker-server/contents/server/src/BackupServiceImpl.h
@@ -28,8 +28,9 @@
backup::RecoverBackupKeyResponse> *
RecoverBackupKey(grpc::CallbackServerContext *context) override;
- grpc::ServerBidiReactor<backup::PullBackupRequest, backup::PullBackupResponse>
- *PullBackup(grpc::CallbackServerContext *context) override;
+ grpc::ServerWriteReactor<backup::PullBackupResponse> *PullBackup(
+ grpc::CallbackServerContext *context,
+ const backup::PullBackupRequest *request) override;
};
} // namespace network
diff --git a/services/backup/docker-server/contents/server/src/BackupServiceImpl.cpp b/services/backup/docker-server/contents/server/src/BackupServiceImpl.cpp
--- a/services/backup/docker-server/contents/server/src/BackupServiceImpl.cpp
+++ b/services/backup/docker-server/contents/server/src/BackupServiceImpl.cpp
@@ -38,9 +38,13 @@
return new reactor::RecoverBackupKeyReactor();
}
-grpc::ServerBidiReactor<backup::PullBackupRequest, backup::PullBackupResponse> *
-BackupServiceImpl::PullBackup(grpc::CallbackServerContext *context) {
- return new reactor::PullBackupReactor();
+grpc::ServerWriteReactor<backup::PullBackupResponse> *
+BackupServiceImpl::PullBackup(
+ grpc::CallbackServerContext *context,
+ const backup::PullBackupRequest *request) {
+ reactor::PullBackupReactor *reactor = new reactor::PullBackupReactor(request);
+ reactor->NextWrite();
+ return reactor;
}
} // namespace network
diff --git a/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientReadReactorBase.h b/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientReadReactorBase.h
--- a/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientReadReactorBase.h
+++ b/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientReadReactorBase.h
@@ -22,8 +22,7 @@
void OnDone(const grpc::Status &status) override;
bool isDone();
- virtual std::unique_ptr<grpc::Status>
- readResponse(const Response &response) = 0;
+ virtual std::unique_ptr<grpc::Status> readResponse(Response &response) = 0;
virtual void validate(){};
virtual void doneCallback(){};
virtual void terminateCallback(){};
diff --git a/services/backup/docker-server/contents/server/src/Reactors/client/blob/BlobGetClientReactor.h b/services/backup/docker-server/contents/server/src/Reactors/client/blob/BlobGetClientReactor.h
new file mode 100644
--- /dev/null
+++ b/services/backup/docker-server/contents/server/src/Reactors/client/blob/BlobGetClientReactor.h
@@ -0,0 +1,57 @@
+#pragma once
+
+#include "ClientReadReactorBase.h"
+#include "Constants.h"
+
+#include "../_generated/blob.grpc.pb.h"
+#include "../_generated/blob.pb.h"
+
+#include <folly/MPMCQueue.h>
+#include <grpcpp/grpcpp.h>
+
+#include <condition_variable>
+#include <iostream>
+#include <memory>
+#include <string>
+
+namespace comm {
+namespace network {
+namespace reactor {
+
+class BlobGetClientReactor
+ : public ClientReadReactorBase<blob::GetRequest, blob::GetResponse> {
+ std::string holder;
+ std::shared_ptr<folly::MPMCQueue<std::string>> dataChunks;
+
+public:
+ BlobGetClientReactor(
+ const std::string &holder,
+ std::shared_ptr<folly::MPMCQueue<std::string>> dataChunks);
+
+ std::unique_ptr<grpc::Status>
+ readResponse(blob::GetResponse &response) override;
+ void doneCallback() override;
+};
+
+BlobGetClientReactor::BlobGetClientReactor(
+ const std::string &holder,
+ std::shared_ptr<folly::MPMCQueue<std::string>> dataChunks)
+ : holder(holder), dataChunks(dataChunks) {
+}
+
+std::unique_ptr<grpc::Status>
+BlobGetClientReactor::readResponse(blob::GetResponse &response) {
+ if (!this->dataChunks->write(std::move(*response.mutable_datachunk()))) {
+ throw std::runtime_error(
+ "error reading compaction data from the blob service");
+ }
+ return nullptr;
+}
+
+void BlobGetClientReactor::doneCallback() {
+ this->dataChunks->write("");
+}
+
+} // namespace reactor
+} // namespace network
+} // namespace comm
diff --git a/services/backup/docker-server/contents/server/src/Reactors/server/PullBackupReactor.h b/services/backup/docker-server/contents/server/src/Reactors/server/PullBackupReactor.h
--- a/services/backup/docker-server/contents/server/src/Reactors/server/PullBackupReactor.h
+++ b/services/backup/docker-server/contents/server/src/Reactors/server/PullBackupReactor.h
@@ -1,6 +1,6 @@
#pragma once
-#include "ServerBidiReactorBase.h"
+#include "ServerWriteReactorBase.h"
#include "../_generated/backup.grpc.pb.h"
#include "../_generated/backup.pb.h"
@@ -13,21 +13,22 @@
namespace network {
namespace reactor {
-class PullBackupReactor : public ServerBidiReactorBase<
+class PullBackupReactor : public ServerWriteReactorBase<
backup::PullBackupRequest,
backup::PullBackupResponse> {
public:
- std::unique_ptr<ServerBidiReactorStatus> handleRequest(
- backup::PullBackupRequest request,
- backup::PullBackupResponse *response) override;
+ using ServerWriteReactorBase<
+ backup::PullBackupRequest,
+ backup::PullBackupResponse>::ServerWriteReactorBase;
+
+ std::unique_ptr<grpc::Status>
+ writeResponse(backup::PullBackupResponse *response) override;
};
-std::unique_ptr<ServerBidiReactorStatus> PullBackupReactor::handleRequest(
- backup::PullBackupRequest request,
- backup::PullBackupResponse *response) {
+std::unique_ptr<grpc::Status>
+PullBackupReactor::writeResponse(backup::PullBackupResponse *response) {
// TODO handle request
- return std::make_unique<ServerBidiReactorStatus>(
- grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "unimplemented"));
+ return std::make_unique<grpc::Status>(grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "unimplemented"));
}
} // namespace reactor

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 8:40 AM (20 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2592975
Default Alt Text
D3627.id11386.diff (58 KB)

Event Timeline