Page MenuHomePhabricator

D3950.diff
No OneTemporary

D3950.diff

diff --git a/services/backup/src/Constants.h b/services/backup/src/Constants.h
--- a/services/backup/src/Constants.h
+++ b/services/backup/src/Constants.h
@@ -7,23 +7,6 @@
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";
-
const std::string LOG_TABLE_NAME = decorateTableName("backup-service-log");
const std::string BACKUP_TABLE_NAME =
decorateTableName("backup-service-backup");
diff --git a/services/backup/src/Reactors/client/blob/BlobPutClientReactor.h b/services/backup/src/Reactors/client/blob/BlobPutClientReactor.h
--- a/services/backup/src/Reactors/client/blob/BlobPutClientReactor.h
+++ b/services/backup/src/Reactors/client/blob/BlobPutClientReactor.h
@@ -1,6 +1,7 @@
#pragma once
#include "Constants.h"
+#include "GlobalConstants.h"
#include "../_generated/blob.grpc.pb.h"
#include "../_generated/blob.pb.h"
diff --git a/services/blob/src/AwsS3Bucket.cpp b/services/blob/src/AwsS3Bucket.cpp
--- a/services/blob/src/AwsS3Bucket.cpp
+++ b/services/blob/src/AwsS3Bucket.cpp
@@ -1,5 +1,6 @@
#include "AwsS3Bucket.h"
#include "Constants.h"
+#include "GlobalConstants.h"
#include "MultiPartUploader.h"
#include "S3Tools.h"
#include "Tools.h"
diff --git a/services/blob/src/Constants.h b/services/blob/src/Constants.h
--- a/services/blob/src/Constants.h
+++ b/services/blob/src/Constants.h
@@ -7,24 +7,9 @@
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;
// 5MB limit
const size_t AWS_MULTIPART_UPLOAD_MINIMUM_CHUNK_SIZE = 5 * 1024 * 1024;
-const std::string AWS_REGION = "us-east-2";
const std::string BLOB_BUCKET_NAME = "commapp-blob";
const std::string BLOB_TABLE_NAME = decorateTableName("blob-service-blob");
diff --git a/services/blob/src/Reactors/server/GetReactor.h b/services/blob/src/Reactors/server/GetReactor.h
--- a/services/blob/src/Reactors/server/GetReactor.h
+++ b/services/blob/src/Reactors/server/GetReactor.h
@@ -1,5 +1,6 @@
#pragma once
+#include "GlobalConstants.h"
#include "S3Tools.h"
#include "ServerWriteReactorBase.h"
diff --git a/services/blob/src/S3Tools.cpp b/services/blob/src/S3Tools.cpp
--- a/services/blob/src/S3Tools.cpp
+++ b/services/blob/src/S3Tools.cpp
@@ -1,5 +1,6 @@
#include "S3Tools.h"
#include "Constants.h"
+#include "GlobalConstants.h"
#include "Tools.h"
#include <aws/s3/model/Bucket.h>
diff --git a/services/blob/src/Tools.cpp b/services/blob/src/Tools.cpp
--- a/services/blob/src/Tools.cpp
+++ b/services/blob/src/Tools.cpp
@@ -3,6 +3,7 @@
#include "Constants.h"
#include "DatabaseEntitiesTools.h"
#include "DatabaseManager.h"
+#include "GlobalConstants.h"
#include "S3Tools.h"
#include <openssl/sha.h>
diff --git a/services/lib/src/DynamoDBTools.cpp b/services/lib/src/DynamoDBTools.cpp
--- a/services/lib/src/DynamoDBTools.cpp
+++ b/services/lib/src/DynamoDBTools.cpp
@@ -1,5 +1,6 @@
#include "DynamoDBTools.h"
#include "Constants.h"
+#include "GlobalConstants.h"
namespace comm {
namespace network {
diff --git a/services/blob/src/Constants.h b/services/lib/src/GlobalConstants.h
copy from services/blob/src/Constants.h
copy to services/lib/src/GlobalConstants.h
--- a/services/blob/src/Constants.h
+++ b/services/lib/src/GlobalConstants.h
@@ -1,7 +1,5 @@
#pragma once
-#include "Tools.h"
-
#include <string>
namespace comm {
@@ -21,15 +19,8 @@
// 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;
-// 5MB limit
-const size_t AWS_MULTIPART_UPLOAD_MINIMUM_CHUNK_SIZE = 5 * 1024 * 1024;
const std::string AWS_REGION = "us-east-2";
-const std::string BLOB_BUCKET_NAME = "commapp-blob";
-
-const std::string BLOB_TABLE_NAME = decorateTableName("blob-service-blob");
-const std::string REVERSE_INDEX_TABLE_NAME =
- decorateTableName("blob-service-reverse-index");
} // namespace network
} // namespace comm

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 16, 11:32 PM (13 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2507295
Default Alt Text
D3950.diff (5 KB)

Event Timeline