Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3355321
D3468.id10723.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D3468.id10723.diff
View Options
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 "ServerReadReactorBase.h"
-#include "ServerBidiReactorBase.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
diff --git a/services/backup/docker-server/contents/server/src/Reactors/server/RecoverBackupKeyReactor.h b/services/backup/docker-server/contents/server/src/Reactors/server/RecoverBackupKeyReactor.h
new file mode 100644
--- /dev/null
+++ b/services/backup/docker-server/contents/server/src/Reactors/server/RecoverBackupKeyReactor.h
@@ -0,0 +1,34 @@
+#pragma once
+
+#include "ServerBidiReactorBase.h"
+
+#include "../_generated/backup.grpc.pb.h"
+#include "../_generated/backup.pb.h"
+
+#include <iostream>
+#include <memory>
+#include <string>
+
+namespace comm {
+namespace network {
+namespace reactor {
+
+class RecoverBackupKeyReactor : public ServerBidiReactorBase<
+ backup::RecoverBackupKeyRequest,
+ backup::RecoverBackupKeyResponse> {
+public:
+ std::unique_ptr<ServerBidiReactorStatus> handleRequest(
+ backup::RecoverBackupKeyRequest request,
+ backup::RecoverBackupKeyResponse *response);
+};
+
+std::unique_ptr<ServerBidiReactorStatus> RecoverBackupKeyReactor::handleRequest(
+ backup::RecoverBackupKeyRequest request,
+ backup::RecoverBackupKeyResponse *response) { // TODO handle request
+ return std::make_unique<ServerBidiReactorStatus>(
+ grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "unimplemented"));
+}
+
+} // namespace reactor
+} // namespace network
+} // namespace comm
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 2:17 PM (19 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2576263
Default Alt Text
D3468.id10723.diff (5 KB)
Attached To
Mode
D3468: [services] Backup - Update service implementation
Attached
Detach File
Event Timeline
Log In to Comment