Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3404581
D5473.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D5473.diff
View Options
diff --git a/services/backup/src/DatabaseEntities/BackupItem.h b/services/backup/src/DatabaseEntities/BackupItem.h
--- a/services/backup/src/DatabaseEntities/BackupItem.h
+++ b/services/backup/src/DatabaseEntities/BackupItem.h
@@ -41,7 +41,7 @@
void validate() const override;
public:
- static std::string tableName;
+ static const std::string TABLE_NAME;
static const std::string FIELD_USER_ID;
static const std::string FIELD_BACKUP_ID;
static const std::string FIELD_CREATED;
diff --git a/services/backup/src/DatabaseEntities/BackupItem.cpp b/services/backup/src/DatabaseEntities/BackupItem.cpp
--- a/services/backup/src/DatabaseEntities/BackupItem.cpp
+++ b/services/backup/src/DatabaseEntities/BackupItem.cpp
@@ -14,7 +14,7 @@
const std::string BackupItem::FIELD_COMPACTION_HOLDER = "compactionHolder";
const std::string BackupItem::FIELD_ATTACHMENT_HOLDERS = "attachmentHolders";
-std::string BackupItem::tableName = BACKUP_TABLE_NAME;
+const std::string BackupItem::TABLE_NAME = BACKUP_TABLE_NAME;
BackupItem::BackupItem(
std::string userID,
@@ -76,7 +76,7 @@
}
std::string BackupItem::getTableName() const {
- return BackupItem::tableName;
+ return BackupItem::TABLE_NAME;
}
PrimaryKeyDescriptor BackupItem::getPrimaryKeyDescriptor() const {
diff --git a/services/backup/src/DatabaseEntities/LogItem.h b/services/backup/src/DatabaseEntities/LogItem.h
--- a/services/backup/src/DatabaseEntities/LogItem.h
+++ b/services/backup/src/DatabaseEntities/LogItem.h
@@ -28,7 +28,7 @@
void validate() const override;
public:
- static std::string tableName;
+ static const std::string TABLE_NAME;
static const std::string FIELD_BACKUP_ID;
static const std::string FIELD_LOG_ID;
static const std::string FIELD_PERSISTED_IN_BLOB;
diff --git a/services/backup/src/DatabaseEntities/LogItem.cpp b/services/backup/src/DatabaseEntities/LogItem.cpp
--- a/services/backup/src/DatabaseEntities/LogItem.cpp
+++ b/services/backup/src/DatabaseEntities/LogItem.cpp
@@ -16,7 +16,7 @@
const std::string LogItem::FIELD_ATTACHMENT_HOLDERS = "attachmentHolders";
const std::string LogItem::FIELD_DATA_HASH = "dataHash";
-std::string LogItem::tableName = LOG_TABLE_NAME;
+const std::string LogItem::TABLE_NAME = LOG_TABLE_NAME;
LogItem::LogItem(
const std::string backupID,
@@ -83,7 +83,7 @@
}
std::string LogItem::getTableName() const {
- return LogItem::tableName;
+ return LogItem::TABLE_NAME;
}
PrimaryKeyDescriptor LogItem::getPrimaryKeyDescriptor() const {
diff --git a/services/backup/src/DatabaseManager.cpp b/services/backup/src/DatabaseManager.cpp
--- a/services/backup/src/DatabaseManager.cpp
+++ b/services/backup/src/DatabaseManager.cpp
@@ -20,7 +20,7 @@
void DatabaseManager::putBackupItem(const BackupItem &item) {
Aws::DynamoDB::Model::PutItemRequest request;
- request.SetTableName(BackupItem::tableName);
+ request.SetTableName(BackupItem::TABLE_NAME);
request.AddItem(
BackupItem::FIELD_USER_ID,
Aws::DynamoDB::Model::AttributeValue(item.getUserID()));
@@ -64,7 +64,7 @@
std::shared_ptr<BackupItem> item = createItemByType<BackupItem>();
Aws::DynamoDB::Model::QueryRequest req;
- req.SetTableName(BackupItem::tableName);
+ req.SetTableName(BackupItem::TABLE_NAME);
req.SetKeyConditionExpression(BackupItem::FIELD_USER_ID + " = :valueToMatch");
AttributeValues attributeValues;
@@ -97,7 +97,7 @@
void DatabaseManager::putLogItem(const LogItem &item) {
Aws::DynamoDB::Model::PutItemRequest request;
- request.SetTableName(LogItem::tableName);
+ request.SetTableName(LogItem::TABLE_NAME);
request.AddItem(
LogItem::FIELD_BACKUP_ID,
Aws::DynamoDB::Model::AttributeValue(item.getBackupID()));
@@ -140,7 +140,7 @@
std::shared_ptr<LogItem> item = createItemByType<LogItem>();
Aws::DynamoDB::Model::QueryRequest req;
- req.SetTableName(LogItem::tableName);
+ req.SetTableName(LogItem::TABLE_NAME);
req.SetKeyConditionExpression(LogItem::FIELD_BACKUP_ID + " = :valueToMatch");
AttributeValues attributeValues;
diff --git a/services/blob/src/DatabaseEntities/BlobItem.h b/services/blob/src/DatabaseEntities/BlobItem.h
--- a/services/blob/src/DatabaseEntities/BlobItem.h
+++ b/services/blob/src/DatabaseEntities/BlobItem.h
@@ -18,7 +18,7 @@
void validate() const override;
public:
- static std::string tableName;
+ static const std::string TABLE_NAME;
static const std::string FIELD_BLOB_HASH;
static const std::string FIELD_S3_PATH;
static const std::string FIELD_CREATED;
diff --git a/services/blob/src/DatabaseEntities/BlobItem.cpp b/services/blob/src/DatabaseEntities/BlobItem.cpp
--- a/services/blob/src/DatabaseEntities/BlobItem.cpp
+++ b/services/blob/src/DatabaseEntities/BlobItem.cpp
@@ -10,7 +10,7 @@
const std::string BlobItem::FIELD_S3_PATH = "s3Path";
const std::string BlobItem::FIELD_CREATED = "created";
-std::string BlobItem::tableName = BLOB_TABLE_NAME;
+const std::string BlobItem::TABLE_NAME = BLOB_TABLE_NAME;
BlobItem::BlobItem(
const std::string blobHash,
@@ -45,7 +45,7 @@
}
std::string BlobItem::getTableName() const {
- return BlobItem::tableName;
+ return BlobItem::TABLE_NAME;
}
PrimaryKeyDescriptor BlobItem::getPrimaryKeyDescriptor() const {
diff --git a/services/blob/src/DatabaseEntities/ReverseIndexItem.h b/services/blob/src/DatabaseEntities/ReverseIndexItem.h
--- a/services/blob/src/DatabaseEntities/ReverseIndexItem.h
+++ b/services/blob/src/DatabaseEntities/ReverseIndexItem.h
@@ -21,7 +21,7 @@
void validate() const override;
public:
- static std::string tableName;
+ static const std::string TABLE_NAME;
static const std::string FIELD_HOLDER;
static const std::string FIELD_BLOB_HASH;
diff --git a/services/blob/src/DatabaseEntities/ReverseIndexItem.cpp b/services/blob/src/DatabaseEntities/ReverseIndexItem.cpp
--- a/services/blob/src/DatabaseEntities/ReverseIndexItem.cpp
+++ b/services/blob/src/DatabaseEntities/ReverseIndexItem.cpp
@@ -9,7 +9,7 @@
const std::string ReverseIndexItem::FIELD_HOLDER = "holder";
const std::string ReverseIndexItem::FIELD_BLOB_HASH = "blobHash";
-std::string ReverseIndexItem::tableName = REVERSE_INDEX_TABLE_NAME;
+const std::string ReverseIndexItem::TABLE_NAME = REVERSE_INDEX_TABLE_NAME;
ReverseIndexItem::ReverseIndexItem(
const std::string holder,
@@ -38,7 +38,7 @@
}
std::string ReverseIndexItem::getTableName() const {
- return ReverseIndexItem::tableName;
+ return ReverseIndexItem::TABLE_NAME;
}
PrimaryKeyDescriptor ReverseIndexItem::getPrimaryKeyDescriptor() const {
diff --git a/services/blob/src/DatabaseManager.cpp b/services/blob/src/DatabaseManager.cpp
--- a/services/blob/src/DatabaseManager.cpp
+++ b/services/blob/src/DatabaseManager.cpp
@@ -19,7 +19,7 @@
void DatabaseManager::putBlobItem(const BlobItem &item) {
Aws::DynamoDB::Model::PutItemRequest request;
- request.SetTableName(BlobItem::tableName);
+ request.SetTableName(BlobItem::TABLE_NAME);
request.AddItem(
BlobItem::FIELD_BLOB_HASH,
Aws::DynamoDB::Model::AttributeValue(item.getBlobHash()));
@@ -58,7 +58,7 @@
"] already exists");
}
Aws::DynamoDB::Model::PutItemRequest request;
- request.SetTableName(ReverseIndexItem::tableName);
+ request.SetTableName(ReverseIndexItem::TABLE_NAME);
request.AddItem(
ReverseIndexItem::FIELD_HOLDER,
Aws::DynamoDB::Model::AttributeValue(item.getHolder()));
@@ -84,7 +84,7 @@
std::vector<std::shared_ptr<database::ReverseIndexItem>> result;
Aws::DynamoDB::Model::QueryRequest req;
- req.SetTableName(ReverseIndexItem::tableName);
+ req.SetTableName(ReverseIndexItem::TABLE_NAME);
req.SetKeyConditionExpression("blobHash = :valueToMatch");
AttributeValues attributeValues;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 4, 11:50 AM (9 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2614176
Default Alt Text
D5473.diff (7 KB)
Attached To
Mode
D5473: Convert table names to const
Attached
Detach File
Event Timeline
Log In to Comment