Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32554273
D3646.1767194467.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3646.1767194467.diff
View Options
diff --git a/services/backup/docker-server/contents/server/src/Reactors/server/SendLogReactor.h b/services/backup/docker-server/contents/server/src/Reactors/server/SendLogReactor.h
--- a/services/backup/docker-server/contents/server/src/Reactors/server/SendLogReactor.h
+++ b/services/backup/docker-server/contents/server/src/Reactors/server/SendLogReactor.h
@@ -2,6 +2,7 @@
#include "Constants.h"
#include "ServerReadReactorBase.h"
+#include "ServiceBlobClient.h"
#include "../_generated/backup.grpc.pb.h"
#include "../_generated/backup.pb.h"
@@ -32,13 +33,18 @@
PersistenceMethod persistenceMethod = PersistenceMethod::UNKNOWN;
std::string userID;
std::string backupID;
+ std::string hash;
// either the value itself which is a dump of a single operation (if
// `persistedInBlob` is false) or the holder to blob (if `persistedInBlob` is
// true)
std::string value;
+ std::condition_variable blobDoneCV;
+ std::shared_ptr<reactor::BlobPutClientReactor> putReactor;
+ ServiceBlobClient blobClient;
void storeInDatabase();
std::string generateLogID();
+ void initializePutReactor();
void storeInBlob(const std::string &data) {
}
@@ -68,6 +74,22 @@
return generateRandomString();
}
+void SendLogReactor::initializePutReactor() {
+ if (this->value.empty()) {
+ throw std::runtime_error(
+ "put reactor cannot be initialized with empty value");
+ }
+ if (this->hash.empty()) {
+ throw std::runtime_error(
+ "put reactor cannot be initialized with empty hash");
+ }
+ if (this->putReactor == nullptr) {
+ this->putReactor = std::make_shared<reactor::BlobPutClientReactor>(
+ this->value, this->hash, &this->blobDoneCV);
+ this->blobClient.put(this->putReactor);
+ }
+}
+
std::unique_ptr<grpc::Status>
SendLogReactor::readRequest(backup::SendLogRequest request) {
switch (this->state) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 31, 3:21 PM (7 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5872044
Default Alt Text
D3646.1767194467.diff (1 KB)
Attached To
Mode
D3646: [services] Backup - Send log - initialize put reactor method
Attached
Detach File
Event Timeline
Log In to Comment