Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3378105
D3079.id9432.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3079.id9432.diff
View Options
diff --git a/services/backup/docker-server/contents/server/src/Constants.h b/services/backup/docker-server/contents/server/src/Constants.h
new file mode 100644
--- /dev/null
+++ b/services/backup/docker-server/contents/server/src/Constants.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <string>
+
+namespace comm {
+namespace network {
+
+// 4MB limit
+// WARNING: use keeping in mind that grpc adds its own headers to messages
+// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
+// so the message that actually is being sent over the network looks like this
+// [Compressed-Flag] [Message-Length] [Message]
+// [Compressed-Flag] 1 byte - added by grpc
+// [Message-Length] 4 bytes - added by grpc
+// [Message] N bytes - actual data
+// so for every message we get 5 additional bytes of data
+// as mentioned here
+// https://github.com/grpc/grpc/issues/15734#issuecomment-396962671
+// grpc stream may contain more than one message
+const size_t GRPC_CHUNK_SIZE_LIMIT = 4 * 1024 * 1024;
+const size_t GRPC_METADATA_SIZE_PER_MESSAGE = 5;
+
+const std::string AWS_REGION = "us-east-2";
+
+} // namespace network
+} // namespace comm
diff --git a/services/backup/docker-server/contents/server/src/Tools.h b/services/backup/docker-server/contents/server/src/Tools.h
deleted file mode 100644
--- a/services/backup/docker-server/contents/server/src/Tools.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#pragma once
-
-namespace comm {
-namespace network {
-
-// 4MB limit
-const size_t GRPC_CHUNK_SIZE_LIMIT = 4 * 1024 * 1024;
-
-// 5MB limit
-const size_t AWS_MULTIPART_UPLOAD_MINIMUM_CHUNK_SIZE = 5 * 1024 * 1024;
-
-enum class OBJECT_TYPE {
- ENCRYPTED_BACKUP_KEY = 0,
- TRANSACTION_LOGS = 1,
- COMPACTION = 2,
-};
-
-class invalid_argument_error : public std::runtime_error {
-public:
- invalid_argument_error(std::string errorMessage)
- : std::runtime_error(errorMessage) {
- }
-};
-
-} // namespace network
-} // namespace comm
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 8:58 AM (21 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2593259
Default Alt Text
D3079.id9432.diff (1 KB)
Attached To
Mode
D3079: [services] Backup - add constants
Attached
Detach File
Event Timeline
Log In to Comment