diff --git a/services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h b/services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h index 90633bb7d..82c7b8112 100644 --- a/services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h +++ b/services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h @@ -1,59 +1,69 @@ #pragma once #include "Item.h" #include #include namespace comm { namespace network { namespace database { +/** + * this class is used for representing two things: the rows in the main table, + * and also the rows in the secondary index + * + * Needs userID(pk)-created(sk)-index that projects: + * userID + * backupID + * created + * recoveryData + */ class BackupItem : public Item { std::string userID; std::string backupID; uint64_t created; std::string recoveryData; std::string compactionHolder; std::vector attachmentHolders; void validate() const override; public: static std::string tableName; static const std::string FIELD_USER_ID; static const std::string FIELD_BACKUP_ID; static const std::string FIELD_CREATED; static const std::string FIELD_RECOVERY_DATA; static const std::string FIELD_COMPACTION_HOLDER; static const std::string FIELD_ATTACHMENT_HOLDERS; BackupItem() { } BackupItem( std::string userID, std::string backupID, uint64_t created, std::string recoveryData, std::string compactionHolder, std::vector attachmentHolders); BackupItem(const AttributeValues &itemFromDB); void assignItemFromDatabase(const AttributeValues &itemFromDB) override; std::string getTableName() const override; PrimaryKey getPrimaryKey() const override; PrimaryKeyValue getPrimaryKeyValue() const override; std::string getUserID() const; std::string getBackupID() const; uint64_t getCreated() const; std::string getRecoveryData() const; std::string getCompactionHolder() const; std::vector getAttachmentHolders() const; }; } // namespace database } // namespace network } // namespace comm diff --git a/services/blob/docker-server/contents/server/src/DatabaseEntities/ReverseIndexItem.h b/services/blob/docker-server/contents/server/src/DatabaseEntities/ReverseIndexItem.h index c6b429572..3a7727b8e 100644 --- a/services/blob/docker-server/contents/server/src/DatabaseEntities/ReverseIndexItem.h +++ b/services/blob/docker-server/contents/server/src/DatabaseEntities/ReverseIndexItem.h @@ -1,40 +1,45 @@ #pragma once #include "Item.h" #include namespace comm { namespace network { namespace database { +/** + * Needs blobHash(pk)-index that projects: + * blobHash + * holder + */ class ReverseIndexItem : public Item { std::string holder; std::string blobHash; void validate() const override; public: static std::string tableName; static const std::string FIELD_HOLDER; static const std::string FIELD_BLOB_HASH; ReverseIndexItem() { } ReverseIndexItem(const std::string holder, const std::string blobHash); ReverseIndexItem(const AttributeValues &itemFromDB); void assignItemFromDatabase(const AttributeValues &itemFromDB) override; std::string getTableName() const override; PrimaryKey getPrimaryKey() const override; PrimaryKeyValue getPrimaryKeyValue() const override; std::string getHolder() const; std::string getBlobHash() const; }; } // namespace database } // namespace network } // namespace comm