Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33338734
D5018.1768913239.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
D5018.1768913239.diff
View Options
diff --git a/services/backup/src/Reactors/server/AddAttachmentsUtility.cpp b/services/backup/src/Reactors/server/AddAttachmentsUtility.cpp
--- a/services/backup/src/Reactors/server/AddAttachmentsUtility.cpp
+++ b/services/backup/src/Reactors/server/AddAttachmentsUtility.cpp
@@ -1,5 +1,7 @@
#include "AddAttachmentsUtility.h"
+#include "blob_client/src/lib.rs.h"
+
#include <glog/logging.h>
#include "BackupItem.h"
@@ -49,7 +51,7 @@
}
database::DatabaseManager::getInstance().putLogItem(*logItem);
}
- } catch (std::runtime_error &e) {
+ } catch (std::exception &e) {
LOG(ERROR) << e.what();
status = grpc::Status(grpc::StatusCode::INTERNAL, e.what());
}
@@ -72,10 +74,23 @@
// put into S3
std::condition_variable blobPutDoneCV;
std::mutex blobPutDoneCVMutex;
- // todo:blob perform put
- // todo:blob perform put:add chunk (std::move(data))
- // todo:blob perform put:add chunk ("")
- // todo:blob perform put:wait for completion
+ put_client_initialize_cxx();
+ put_client_write_cxx(
+ tools::getBlobPutField(blob::PutRequest::DataCase::kHolder),
+ holder.c_str());
+ put_client_blocking_read_cxx();
+ put_client_write_cxx(
+ tools::getBlobPutField(blob::PutRequest::DataCase::kBlobHash),
+ newLogItem->getDataHash().c_str());
+ rust::String responseStr = put_client_blocking_read_cxx();
+ // data exists?
+ if (!(bool)tools::charPtrToInt(responseStr.c_str())) {
+ put_client_write_cxx(
+ tools::getBlobPutField(blob::PutRequest::DataCase::kDataChunk),
+ std::move(data).c_str());
+ put_client_blocking_read_cxx();
+ }
+ put_client_terminate_cxx();
return newLogItem;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 20, 12:47 PM (20 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5960836
Default Alt Text
D5018.1768913239.diff (1 KB)
Attached To
Mode
D5018: [services] Backup - Use Blob client in c++ - Implement add attachment
Attached
Detach File
Event Timeline
Log In to Comment