Page MenuHomePhabricator

D3468.diff
No OneTemporary

D3468.diff

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
@@ -1,7 +1,9 @@
#include "BackupServiceImpl.h"
-#include "ServerBidiReactorBase.h"
-#include "ServerReadReactorBase.h"
+#include "CreateNewBackupReactor.h"
+#include "PullBackupReactor.h"
+#include "RecoverBackupKeyReactor.h"
+#include "SendLogReactor.h"
#include <aws/core/Aws.h>
@@ -20,79 +22,25 @@
backup::CreateNewBackupRequest,
backup::CreateNewBackupResponse> *
BackupServiceImpl::CreateNewBackup(grpc::CallbackServerContext *context) {
- class CreateNewBackupReactor : public reactor::ServerBidiReactorBase<
- backup::CreateNewBackupRequest,
- backup::CreateNewBackupResponse> {
- public:
- std::unique_ptr<reactor::ServerBidiReactorStatus> handleRequest(
- backup::CreateNewBackupRequest request,
- backup::CreateNewBackupResponse *response) override {
- // TODO handle request
- return std::make_unique<reactor::ServerBidiReactorStatus>(
- grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "unimplemented"));
- }
- };
-
- return new CreateNewBackupReactor();
+ return new reactor::CreateNewBackupReactor();
}
grpc::ServerReadReactor<backup::SendLogRequest> *BackupServiceImpl::SendLog(
grpc::CallbackServerContext *context,
google::protobuf::Empty *response) {
- class SendLogReactor : public reactor::ServerReadReactorBase<
- backup::SendLogRequest,
- google::protobuf::Empty> {
- public:
- using ServerReadReactorBase<
- backup::SendLogRequest,
- google::protobuf::Empty>::ServerReadReactorBase;
- std::unique_ptr<grpc::Status>
- readRequest(backup::SendLogRequest request) override {
- // TODO handle request
- return std::make_unique<grpc::Status>(
- grpc::StatusCode::UNIMPLEMENTED, "unimplemented");
- }
- };
-
- return new SendLogReactor(response);
+ return new reactor::SendLogReactor(response);
}
grpc::ServerBidiReactor<
backup::RecoverBackupKeyRequest,
backup::RecoverBackupKeyResponse> *
BackupServiceImpl::RecoverBackupKey(grpc::CallbackServerContext *context) {
- class RecoverBackupKeyReactor : public reactor::ServerBidiReactorBase<
- backup::RecoverBackupKeyRequest,
- backup::RecoverBackupKeyResponse> {
- public:
- std::unique_ptr<reactor::ServerBidiReactorStatus> handleRequest(
- backup::RecoverBackupKeyRequest request,
- backup::RecoverBackupKeyResponse *response) override {
- // TODO handle request
- return std::make_unique<reactor::ServerBidiReactorStatus>(
- grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "unimplemented"));
- }
- };
-
- return new RecoverBackupKeyReactor();
+ return new reactor::RecoverBackupKeyReactor();
}
grpc::ServerBidiReactor<backup::PullBackupRequest, backup::PullBackupResponse> *
BackupServiceImpl::PullBackup(grpc::CallbackServerContext *context) {
- class PullBackupReactor : public reactor::ServerBidiReactorBase<
- backup::PullBackupRequest,
- backup::PullBackupResponse> {
- public:
- std::unique_ptr<reactor::ServerBidiReactorStatus> handleRequest(
- backup::PullBackupRequest request,
- backup::PullBackupResponse *response) override {
- // TODO handle request
- return std::make_unique<reactor::ServerBidiReactorStatus>(
- grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "unimplemented"));
- }
- };
-
- return new PullBackupReactor();
+ return new reactor::PullBackupReactor();
}
} // namespace network

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 12:40 PM (20 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2575600
Default Alt Text
D3468.diff (3 KB)

Event Timeline