Commit d18361a7 authored by Cedric CAFFY's avatar Cedric CAFFY
Browse files

Added UNIQUE constraint on STORAGE_CLASS_NAME and removed the the UNIQUE...

Added UNIQUE constraint on STORAGE_CLASS_NAME and removed the the UNIQUE constraint on DISK_INSTANCE_NAME and STORAGE_CLASS_NAME
parent ffc25c16
Pipeline #37 failed with stages
......@@ -66,7 +66,7 @@ CREATE TABLE STORAGE_CLASS(
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_LUHN_NN NOT NULL,
LAST_UPDATE_TIME BIGINT UNSIGNED CONSTRAINT STORAGE_CLASS_LUT_NN NOT NULL,
CONSTRAINT STORAGE_CLASS_PK PRIMARY KEY(STORAGE_CLASS_ID),
CONSTRAINT STORAGE_CLASS_DIN_SCN_UN UNIQUE(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)
CONSTRAINT STORAGE_CLASS_SCN_UN UNIQUE(STORAGE_CLASS_NAME)
);
CREATE TABLE TAPE_POOL(
TAPE_POOL_ID BIGINT UNSIGNED CONSTRAINT TAPE_POOL_TPI_NN NOT NULL,
......
......@@ -88,7 +88,7 @@ CREATE TABLE STORAGE_CLASS(
LAST_UPDATE_HOST_NAME VARCHAR2(100) CONSTRAINT STORAGE_CLASS_LUHN_NN NOT NULL,
LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT STORAGE_CLASS_LUT_NN NOT NULL,
CONSTRAINT STORAGE_CLASS_PK PRIMARY KEY(STORAGE_CLASS_ID),
CONSTRAINT STORAGE_CLASS_DIN_SCN_UN UNIQUE(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)
CONSTRAINT STORAGE_CLASS_SCN_UN UNIQUE(STORAGE_CLASS_NAME)
);
CREATE TABLE TAPE_POOL(
TAPE_POOL_ID NUMERIC(20, 0) CONSTRAINT TAPE_POOL_TPI_NN NOT NULL,
......
......@@ -73,7 +73,7 @@ CREATE TABLE STORAGE_CLASS(
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_LUHN_NN NOT NULL,
LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT STORAGE_CLASS_LUT_NN NOT NULL,
CONSTRAINT STORAGE_CLASS_PK PRIMARY KEY(STORAGE_CLASS_ID),
CONSTRAINT STORAGE_CLASS_DIN_SCN_UN UNIQUE(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)
CONSTRAINT STORAGE_CLASS_SCN_UN UNIQUE(STORAGE_CLASS_NAME)
);
CREATE TABLE TAPE_POOL(
TAPE_POOL_ID NUMERIC(20, 0) CONSTRAINT TAPE_POOL_TPI_NN NOT NULL,
......
......@@ -57,7 +57,7 @@ CREATE TABLE STORAGE_CLASS(
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_LUHN_NN NOT NULL,
LAST_UPDATE_TIME INTEGER CONSTRAINT STORAGE_CLASS_LUT_NN NOT NULL,
CONSTRAINT STORAGE_CLASS_PK PRIMARY KEY(STORAGE_CLASS_ID),
CONSTRAINT STORAGE_CLASS_DIN_SCN_UN UNIQUE(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)
CONSTRAINT STORAGE_CLASS_SCN_UN UNIQUE(STORAGE_CLASS_NAME)
);
CREATE TABLE TAPE_POOL(
TAPE_POOL_ID INTEGER CONSTRAINT TAPE_POOL_TPI_NN NOT NULL,
......
......@@ -1314,7 +1314,7 @@ namespace catalogue{
" LAST_UPDATE_HOST_NAME VARCHAR2(100) CONSTRAINT STORAGE_CLASS_LUHN_NN NOT NULL,"
" LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT STORAGE_CLASS_LUT_NN NOT NULL,"
" CONSTRAINT STORAGE_CLASS_PK PRIMARY KEY(STORAGE_CLASS_ID),"
" CONSTRAINT STORAGE_CLASS_DIN_SCN_UN UNIQUE(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)"
" CONSTRAINT STORAGE_CLASS_SCN_UN UNIQUE(STORAGE_CLASS_NAME)"
");"
"CREATE TABLE TAPE_POOL("
" TAPE_POOL_ID NUMERIC(20, 0) CONSTRAINT TAPE_POOL_TPI_NN NOT NULL,"
......@@ -1619,7 +1619,7 @@ namespace catalogue{
" LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_LUHN_NN NOT NULL,"
" LAST_UPDATE_TIME BIGINT UNSIGNED CONSTRAINT STORAGE_CLASS_LUT_NN NOT NULL,"
" CONSTRAINT STORAGE_CLASS_PK PRIMARY KEY(STORAGE_CLASS_ID),"
" CONSTRAINT STORAGE_CLASS_DIN_SCN_UN UNIQUE(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)"
" CONSTRAINT STORAGE_CLASS_SCN_UN UNIQUE(STORAGE_CLASS_NAME)"
");"
"CREATE TABLE TAPE_POOL("
" TAPE_POOL_ID BIGINT UNSIGNED CONSTRAINT TAPE_POOL_TPI_NN NOT NULL,"
......@@ -1914,7 +1914,7 @@ namespace catalogue{
" LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_LUHN_NN NOT NULL,"
" LAST_UPDATE_TIME INTEGER CONSTRAINT STORAGE_CLASS_LUT_NN NOT NULL,"
" CONSTRAINT STORAGE_CLASS_PK PRIMARY KEY(STORAGE_CLASS_ID),"
" CONSTRAINT STORAGE_CLASS_DIN_SCN_UN UNIQUE(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)"
" CONSTRAINT STORAGE_CLASS_SCN_UN UNIQUE(STORAGE_CLASS_NAME)"
");"
"CREATE TABLE TAPE_POOL("
" TAPE_POOL_ID INTEGER CONSTRAINT TAPE_POOL_TPI_NN NOT NULL,"
......@@ -2223,7 +2223,7 @@ namespace catalogue{
" LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_LUHN_NN NOT NULL,"
" LAST_UPDATE_TIME NUMERIC(20, 0) CONSTRAINT STORAGE_CLASS_LUT_NN NOT NULL,"
" CONSTRAINT STORAGE_CLASS_PK PRIMARY KEY(STORAGE_CLASS_ID),"
" CONSTRAINT STORAGE_CLASS_DIN_SCN_UN UNIQUE(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)"
" CONSTRAINT STORAGE_CLASS_SCN_UN UNIQUE(STORAGE_CLASS_NAME)"
");"
"CREATE TABLE TAPE_POOL("
" TAPE_POOL_ID NUMERIC(20, 0) CONSTRAINT TAPE_POOL_TPI_NN NOT NULL,"
......
......@@ -238,26 +238,22 @@ public:
/**
* Deletes the specified storage class.
*
* @param diskInstanceName The name of the disk instance to which the
* storage class belongs.
* @param stoargeClassName The name of the storage class which is only
* @param storageClassName The name of the storage class which is only
* guaranteed to be unique within its disk isntance.
*/
virtual void deleteStorageClass(const std::string &diskInstanceName, const std::string &storageClassName) = 0;
virtual void deleteStorageClass(const std::string &storageClassName) = 0;
virtual std::list<common::dataStructures::StorageClass> getStorageClasses() const = 0;
virtual void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const uint64_t nbCopies) = 0;
virtual void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const std::string &comment) = 0;
virtual void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t nbCopies) = 0;
virtual void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) = 0;
/**
* Modifies the name of the specified storage class.
*
* @param diskInstanceName The name of the disk instance to which the
* storage class belongs.
* @param currentName The current name of the storage class.
* @param newName The new name of the storage class.
*/
virtual void modifyStorageClassName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &currentName, const std::string &newName) = 0;
virtual void modifyStorageClassName(const common::dataStructures::SecurityIdentity &admin, const std::string &currentName, const std::string &newName) = 0;
virtual void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const cta::optional<std::string> &supply, const std::string &comment) = 0;
virtual void deleteTapePool(const std::string &name) = 0;
......@@ -279,7 +275,6 @@ public:
virtual void createArchiveRoute(
const common::dataStructures::SecurityIdentity &admin,
const std::string &diskInstanceName,
const std::string &storageClassName,
const uint32_t copyNb,
const std::string &tapePoolName,
......@@ -288,14 +283,10 @@ public:
/**
* Deletes the specified archive route.
*
* @param diskInstanceName The name of the disk instance to which the storage
* class belongs.
* @param storageClassName The name of the storage class which is only
* guaranteed to be unique within its disk instance.
* @param storageClassName The name of the storage class which is unique
* @param copyNb The copy number of the tape file.
*/
virtual void deleteArchiveRoute(
const std::string &diskInstanceName,
const std::string &storageClassName,
const uint32_t copyNb) = 0;
......@@ -309,18 +300,15 @@ public:
* For a given storage class there should be no more than one route to any
* given tape pool.
*
* @param diskInstanceName The name of the disk instance to which the storage
* class belongs.
* @param storageClassName The name of the storage class which is only
* guaranteed to be unique within its disk instance.
* @param storageClassName The name of the storage class which is unique
* @param tapePoolName The name of the tape pool.
*/
virtual std::list<common::dataStructures::ArchiveRoute> getArchiveRoutes(
const std::string &diskInstanceName, const std::string &storageClassName,
const std::string &storageClassName,
const std::string &tapePoolName) const = 0;
virtual void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) = 0;
virtual void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) = 0;
virtual void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) = 0;
virtual void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) = 0;
virtual void createLogicalLibrary(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const bool isDisabled, const std::string &comment) = 0;
virtual void deleteLogicalLibrary(const std::string &name) = 0;
......
......@@ -120,24 +120,24 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->createStorageClass(admin, storageClass);}, m_maxTriesToConnect);
}
void deleteStorageClass(const std::string &diskInstanceName, const std::string &storageClassName) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->deleteStorageClass(diskInstanceName, storageClassName);}, m_maxTriesToConnect);
void deleteStorageClass(const std::string &storageClassName) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->deleteStorageClass(storageClassName);}, m_maxTriesToConnect);
}
std::list<common::dataStructures::StorageClass> getStorageClasses() const override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->getStorageClasses();}, m_maxTriesToConnect);
}
void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const uint64_t nbCopies) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyStorageClassNbCopies(admin, instanceName, name, nbCopies);}, m_maxTriesToConnect);
void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t nbCopies) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyStorageClassNbCopies(admin, name, nbCopies);}, m_maxTriesToConnect);
}
void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyStorageClassComment(admin, instanceName, name, comment);}, m_maxTriesToConnect);
void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyStorageClassComment(admin, name, comment);}, m_maxTriesToConnect);
}
void modifyStorageClassName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &currentName, const std::string &newName) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyStorageClassName(admin, instanceName, currentName, newName);}, m_maxTriesToConnect);
void modifyStorageClassName(const common::dataStructures::SecurityIdentity &admin, const std::string &currentName, const std::string &newName) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyStorageClassName(admin, currentName, newName);}, m_maxTriesToConnect);
}
void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const cta::optional<std::string> &supply, const std::string &comment) override {
......@@ -176,28 +176,28 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyTapePoolName(admin, currentName, newName);}, m_maxTriesToConnect);
}
void createArchiveRoute(const common::dataStructures::SecurityIdentity &admin, const std::string &diskInstanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createArchiveRoute(admin, diskInstanceName, storageClassName, copyNb, tapePoolName, comment);}, m_maxTriesToConnect);
void createArchiveRoute(const common::dataStructures::SecurityIdentity &admin, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createArchiveRoute(admin, storageClassName, copyNb, tapePoolName, comment);}, m_maxTriesToConnect);
}
void deleteArchiveRoute(const std::string &diskInstanceName, const std::string &storageClassName, const uint32_t copyNb) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->deleteArchiveRoute(diskInstanceName, storageClassName, copyNb);}, m_maxTriesToConnect);
void deleteArchiveRoute(const std::string &storageClassName, const uint32_t copyNb) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->deleteArchiveRoute(storageClassName, copyNb);}, m_maxTriesToConnect);
}
std::list<common::dataStructures::ArchiveRoute> getArchiveRoutes() const override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->getArchiveRoutes();}, m_maxTriesToConnect);
}
std::list<common::dataStructures::ArchiveRoute> getArchiveRoutes(const std::string &diskInstanceName, const std::string &storageClassName, const std::string &tapePoolName) const override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->getArchiveRoutes(diskInstanceName, storageClassName, tapePoolName);}, m_maxTriesToConnect);
std::list<common::dataStructures::ArchiveRoute> getArchiveRoutes(const std::string &storageClassName, const std::string &tapePoolName) const override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->getArchiveRoutes(storageClassName, tapePoolName);}, m_maxTriesToConnect);
}
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyArchiveRouteTapePoolName(admin, instanceName, storageClassName, copyNb, tapePoolName);}, m_maxTriesToConnect);
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyArchiveRouteTapePoolName(admin, storageClassName, copyNb, tapePoolName);}, m_maxTriesToConnect);
}
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyArchiveRouteComment(admin, instanceName, storageClassName, copyNb, comment);}, m_maxTriesToConnect);
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyArchiveRouteComment(admin, storageClassName, copyNb, comment);}, m_maxTriesToConnect);
}
void createLogicalLibrary(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const bool isDisabled, const std::string &comment) override {
......
This diff is collapsed.
......@@ -36,7 +36,7 @@ public:
void createActivitiesFairShareWeight(const common::dataStructures::SecurityIdentity& admin, const std::string& diskInstanceName, const std::string& acttivity, double weight, const std::string & comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createAdminUser(const common::dataStructures::SecurityIdentity& admin, const std::string& username, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createArchiveRoute(const common::dataStructures::SecurityIdentity& admin, const std::string& diskInstanceName, const std::string& storageClassName, const uint32_t copyNb, const std::string& tapePoolName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createArchiveRoute(const common::dataStructures::SecurityIdentity& admin, const std::string& storageClassName, const uint32_t copyNb, const std::string& tapePoolName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createLogicalLibrary(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const bool isDisabled, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createMountPolicy(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t archivePriority, const uint64_t minArchiveRequestAge, const uint64_t retrievePriority, const uint64_t minRetrieveRequestAge, const uint64_t maxDrivesAllowed, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createRequesterGroupMountRule(const common::dataStructures::SecurityIdentity& admin, const std::string& mountPolicyName, const std::string& diskInstanceName, const std::string& requesterGroupName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......@@ -47,12 +47,12 @@ public:
void deleteActivitiesFairShareWeight(const common::dataStructures::SecurityIdentity& admin, const std::string& diskInstanceName, const std::string& acttivity) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteAdminUser(const std::string& username) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteArchiveFile(const std::string& instanceName, const uint64_t archiveFileId, log::LogContext &lc) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteArchiveRoute(const std::string& diskInstanceName, const std::string& storageClassName, const uint32_t copyNb) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteArchiveRoute(const std::string& storageClassName, const uint32_t copyNb) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteLogicalLibrary(const std::string& name) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteMountPolicy(const std::string& name) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteRequesterGroupMountRule(const std::string& diskInstanceName, const std::string& requesterGroupName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteRequesterMountRule(const std::string& diskInstanceName, const std::string& requesterName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteStorageClass(const std::string& diskInstanceName, const std::string& storageClassName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteStorageClass(const std::string& storageClassName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteTape(const std::string& vid) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteTapePool(const std::string& name) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void filesWrittenToTape(const std::set<TapeItemWrittenPointer>& event) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......@@ -72,7 +72,7 @@ public:
std::list<common::dataStructures::ArchiveFile> getFilesForRepack(const std::string &vid, const uint64_t startFSeq, const uint64_t maxNbFiles) const override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
ArchiveFileItor getArchiveFilesForRepackItor(const std::string &vid, const uint64_t startFSeq) const override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
std::list<common::dataStructures::ArchiveRoute> getArchiveRoutes() const { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
std::list<common::dataStructures::ArchiveRoute> getArchiveRoutes(const std::string &diskInstanceName, const std::string &storageClassName, const std::string &tapePoolName) const override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
std::list<common::dataStructures::ArchiveRoute> getArchiveRoutes(const std::string &storageClassName, const std::string &tapePoolName) const override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
std::list<common::dataStructures::LogicalLibrary> getLogicalLibraries() const { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
std::list<common::dataStructures::MountPolicy> getMountPolicies() const { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
std::list<common::dataStructures::RequesterGroupMountRule> getRequesterGroupMountRules() const { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......@@ -87,8 +87,8 @@ public:
bool isAdmin(const common::dataStructures::SecurityIdentity& admin) const { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyActivitiesFairShareWeight(const common::dataStructures::SecurityIdentity& admin, const std::string& diskInstanceName, const std::string& acttivity, double weight, const std::string & comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyAdminUserComment(const common::dataStructures::SecurityIdentity& admin, const std::string& username, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& storageClassName, const uint32_t copyNb, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& storageClassName, const uint32_t copyNb, const std::string& tapePoolName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity& admin, const std::string& storageClassName, const uint32_t copyNb, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity& admin, const std::string& storageClassName, const uint32_t copyNb, const std::string& tapePoolName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyLogicalLibraryName(const common::dataStructures::SecurityIdentity &admin, const std::string &currentName, const std::string &newName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyLogicalLibraryComment(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void setLogicalLibraryDisabled(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const bool disabledValue) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......@@ -102,9 +102,9 @@ public:
void modifyRequesterGroupMountRuleComment(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& requesterGroupName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyRequesterGroupMountRulePolicy(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& requesterGroupName, const std::string& mountPolicy) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyRequesterMountRulePolicy(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& requesterName, const std::string& mountPolicy) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyStorageClassComment(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& name, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyStorageClassName(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& currentName, const std::string& newName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& name, const uint64_t nbCopies) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyStorageClassComment(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyStorageClassName(const common::dataStructures::SecurityIdentity& admin, const std::string& currentName, const std::string& newName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t nbCopies) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyTapeCapacityInBytes(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const uint64_t capacityInBytes) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyTapeComment(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyTapeEncryptionKeyName(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const std::string& encryptionKeyName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......
This diff is collapsed.
......@@ -225,26 +225,22 @@ public:
/**
* Deletes the specified storage class.
*
* @param diskInstanceName The name of the disk instance to which the
* storage class belongs.
* @param stoargeClassName The name of the storage class which is only
* guaranteed to be unique within its disk isntance.
*/
void deleteStorageClass(const std::string &diskInstanceName, const std::string &storageClassName) override;
void deleteStorageClass(const std::string &storageClassName) override;
std::list<common::dataStructures::StorageClass> getStorageClasses() const override;
void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const uint64_t nbCopies) override;
void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const std::string &comment) override;
void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t nbCopies) override;
void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override;
/**
* Modifies the name of the specified storage class.
*
* @param diskInstanceName The name of the disk instance to which the
* storage class belongs.
* @param currentName The current name of the storage class.
* @param newName The new name of the storage class.
*/
void modifyStorageClassName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &currentName, const std::string &newName) override;
void modifyStorageClassName(const common::dataStructures::SecurityIdentity &admin, const std::string &currentName, const std::string &newName) override;
void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const cta::optional<std::string> &supply, const std::string &comment) override;
void deleteTapePool(const std::string &name) override;
......@@ -266,7 +262,6 @@ public:
void createArchiveRoute(
const common::dataStructures::SecurityIdentity &admin,
const std::string &diskInstanceName,
const std::string &storageClassName,
const uint32_t copyNb,
const std::string &tapePoolName,
......@@ -276,14 +271,10 @@ public:
/**
* Deletes the specified archive route.
*
* @param diskInstanceName The name of the disk instance to which the storage
* class belongs.
* @param storageClassName The name of the storage class which is only
* guaranteed to be unique within its disk instance.
* @param storageClassName The name of the storage class which is unique
* @param copyNb The copy number of the tape file.
*/
void deleteArchiveRoute(
const std::string &diskInstanceName,
const std::string &storageClassName,
const uint32_t copyNb) override;
......@@ -297,18 +288,15 @@ public:
* For a given storage class there should be no more than one route to any
* given tape pool.
*
* @param diskInstanceName The name of the disk instance to which the storage
* class belongs.
* @param storageClassName The name of the storage class which is only
* guaranteed to be unique within its disk instance.
* @param storageClassName The name of the storage class which is unique
* @param tapePoolName The name of the tape pool.
*/
std::list<common::dataStructures::ArchiveRoute> getArchiveRoutes(
const std::string &diskInstanceName, const std::string &storageClassName,
const std::string &storageClassName,
const std::string &tapePoolName) const override;
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) override;
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) override;
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) override;
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) override;
void createLogicalLibrary(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const bool isDisabled, const std::string &comment) override;
void deleteLogicalLibrary(const std::string &name) override;
......@@ -818,13 +806,10 @@ protected:
* Returns true if the specified storage class exists.
*
* @param conn The database connection.
* @param diskInstanceName The name of the disk instance to which the storage
* class belongs.
* @param storageClassName The name of the storage class.
* @return True if the storage class exists.
*/
bool storageClassExists(rdbms::Conn &conn, const std::string &diskInstanceName, const std::string &storageClassName)
const;
bool storageClassExists(rdbms::Conn &conn, const std::string &storageClassName) const;
/**
* Returns true if the specified tape pool exists.
......@@ -899,14 +884,12 @@ protected:
* Returns true if the specified archive route exists.
*
* @param conn The database connection.
* @param diskInstanceName The name of the disk instance to which the storage
* class belongs.
* @param storageClassName The name of the storage class which is only
* guaranteed to be unique within its disk instance.
* @param copyNb The copy number of the tape file.
* @return True if the archive route exists.
*/
bool archiveRouteExists(rdbms::Conn &conn, const std::string &diskInstanceName, const std::string &storageClassName,
bool archiveRouteExists(rdbms::Conn &conn, const std::string &storageClassName,
const uint32_t copyNb) const;
/**
......@@ -918,14 +901,12 @@ protected:
* given tape pool.
*
* @param conn The database connection.
* @param diskInstanceName The name of the disk instance to which the storage
* class belongs.
* @param storageClassName The name of the storage class which is only
* guaranteed to be unique within its disk instance.
* @param tapePoolName The name of the tape pool.
*/
std::list<common::dataStructures::ArchiveRoute> getArchiveRoutes(rdbms::Conn &conn,
const std::string &diskInstanceName, const std::string &storageClassName, const std::string &tapePoolName) const;
const std::string &storageClassName, const std::string &tapePoolName) const;
/**
* Returns true if the specified tape exists.
......@@ -1166,10 +1147,6 @@ protected:
* instance and the name of the storage class.
*/
struct StorageClass {
/**
* The name of the disk instance to which the storage class belongs.
*/
std::string diskInstanceName;
/**
* The name of the storage class which is only guaranteed to be unique
......@@ -1180,12 +1157,10 @@ protected:
/**
* Constructor.
*
* @param dIN The name of the disk instance to which the storage class
* belongs.
* @param sN The name of the storage class which is only guaranteed to be
* unique within its disk instance.
*/
StorageClass(const std::string &d, const std::string &s): diskInstanceName(d), storageClassName(s) {
StorageClass(const std::string &s): storageClassName(s) {
}
/**
......@@ -1196,7 +1171,7 @@ protected:
* side of the operator.
*/
bool operator<(const StorageClass &rhs) const {
return diskInstanceName < rhs.diskInstanceName || storageClassName < rhs.storageClassName;
return storageClassName < rhs.storageClassName;
}
}; // struct StorageClass
......
......@@ -45,7 +45,7 @@ CREATE TABLE STORAGE_CLASS(
LAST_UPDATE_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_LUHN_NN NOT NULL,
LAST_UPDATE_TIME UINT64TYPE CONSTRAINT STORAGE_CLASS_LUT_NN NOT NULL,
CONSTRAINT STORAGE_CLASS_PK PRIMARY KEY(STORAGE_CLASS_ID),
CONSTRAINT STORAGE_CLASS_DIN_SCN_UN UNIQUE(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)
CONSTRAINT STORAGE_CLASS_SCN_UN UNIQUE(STORAGE_CLASS_NAME)
);
CREATE TABLE TAPE_POOL(
TAPE_POOL_ID UINT64TYPE CONSTRAINT TAPE_POOL_TPI_NN NOT NULL,
......
......@@ -104,10 +104,25 @@ ADD (
--changeset ccaffy:14 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"1.0" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE STORAGE_CLASS
DROP CONSTRAINT STORAGE_CLASS_DIN_SCN_UN;
--rollback ALTER TABLE STORAGE_CLASS ADD (
--rollback CONSTRAINT STORAGE_CLASS_DIN_SCN_UN UNIQUE(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)
--rollback );
--changeset ccaffy:15 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"1.0" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
ALTER TABLE STORAGE_CLASS ADD CONSTRAINT STORAGE_CLASS_SCN_UN UNIQUE(STORAGE_CLASS_NAME);
--rollback ALTER TABLE STORAGE_CLASS DROP CONSTRAINT STORAGE_CLASS_SCN_UN;
--changeset ccaffy:16 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"1.0" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
UPDATE CTA_CATALOGUE SET SCHEMA_VERSION_MINOR=1;
--rollback UPDATE CTA_CATALOGUE SET SCHEMA_VERSION_MINOR=0
--changeset ccaffy:15 failOnError:true dbms:oracle
--changeset ccaffy:17 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"1.1" SELECT CONCAT(CONCAT(CAST(SCHEMA_VERSION_MAJOR as VARCHAR(10)),'.'), CAST(SCHEMA_VERSION_MINOR AS VARCHAR(10))) AS CATALOGUE_VERSION FROM CTA_CATALOGUE;
UPDATE CTA_CATALOGUE SET NEXT_SCHEMA_VERSION_MAJOR=NULL;
......
......@@ -34,8 +34,7 @@ ArchiveRoute::ArchiveRoute():
// operator==
//------------------------------------------------------------------------------
bool ArchiveRoute::operator==(const ArchiveRoute &rhs) const {
return diskInstanceName==rhs.diskInstanceName
&& storageClassName==rhs.storageClassName
return storageClassName==rhs.storageClassName
&& copyNb==rhs.copyNb
&& tapePoolName==rhs.tapePoolName
&& creationLog==rhs.creationLog
......@@ -54,8 +53,7 @@ bool ArchiveRoute::operator!=(const ArchiveRoute &rhs) const {
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const ArchiveRoute &obj) {
os << "(diskInstanceName=" << obj.diskInstanceName
<< " storageClassName=" << obj.storageClassName
os << "(storageClassName=" << obj.storageClassName
<< " copyNb=" << obj.copyNb
<< " tapePoolName=" << obj.tapePoolName
<< " creationLog=" << obj.creationLog
......
......@@ -41,11 +41,6 @@ struct ArchiveRoute {
bool operator!=(const ArchiveRoute &rhs) const;
/**
* The name of the disk instance to which the storage class belongs.
*/
std::string diskInstanceName;
/**
* The name of the storage class which is only guranateed to be unique within
* its disk instance.
......@@ -63,7 +58,7 @@ struct ArchiveRoute {
std::string comment;
typedef std::map<uint32_t, ArchiveRoute> StorageClassMap;
typedef std::map<std::tuple<std::string/*disk instance*/, std::string /*storage class*/>, StorageClassMap> FullMap;
typedef std::map<std::string /*storage class*/, StorageClassMap> FullMap;
}; // struct ArchiveRoute
......
......@@ -2374,7 +2374,7 @@ uint64_t OStoreDB::RepackRequest::addSubrequestsAndUpdateStats(std::list<Subrequ
// Set the repack info.
RetrieveRequest::RepackInfo rRRepackInfo;
try {
for (auto & ar: archiveRoutesMap.at(std::make_tuple(rsr.archiveFile.diskInstance, rsr.archiveFile.storageClass))) {
for (auto & ar: archiveRoutesMap.at(rsr.archiveFile.storageClass)) {
rRRepackInfo.archiveRouteMap[ar.second.copyNb] = ar.second.tapePoolName;
}
//Check that we do not have the same destination tapepool for two different copyNb
......@@ -2397,9 +2397,9 @@ uint64_t OStoreDB::RepackRequest::addSubrequestsAndUpdateStats(std::list<Subrequ
std::stringstream storageClassList;
bool first=true;
for (auto & sc: archiveRoutesMap) {
std::string diskInstance, storageClass;
std::tie(diskInstance, storageClass) = sc.first;