Commit 80935975 authored by Steven Murray's avatar Steven Murray
Browse files

Deleted old version of Catalogue::createTape()

parent 670d7419
......@@ -499,24 +499,6 @@ public:
virtual void modifyLogicalLibraryComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) = 0;
virtual void setLogicalLibraryDisabled(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const bool disabledValue) = 0;
/**
* Creates a tape which is assumed to have logical block protection (LBP)
* enabled and isFromCastor disabled.
* TODO THIS METHOD IS DEPRECATED AND SHOULD BE REMOVED. IT IS USED ONLY IN THE UNIT TESTS ! USE THE ONE THAT USES THE TAPE DATASTRUCTURE INSTEAD
*/
virtual void createTape(
const common::dataStructures::SecurityIdentity &admin,
const std::string &vid,
const std::string &mediaType,
const std::string &vendor,
const std::string &logicalLibraryName,
const std::string &tapePoolName,
const uint64_t capacityInBytes,
const bool disabled,
const bool full,
const bool readOnly,
const std::string &comment) = 0;
/**
* Creates a tape which is assumed to have logical block protection (LBP)
* enabled and isFromCastor disabled.
......
......@@ -296,10 +296,6 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->setLogicalLibraryDisabled(admin, name, disabledValue);}, m_maxTriesToConnect);
}
void createTape(const common::dataStructures::SecurityIdentity &admin, const std::string &vid, const std::string &mediaType, const std::string &vendor, const std::string &logicalLibraryName, const std::string &tapePoolName, const uint64_t capacityInBytes, const bool disabled, const bool full, const bool readOnly, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createTape(admin, vid, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes, disabled, full, readOnly, comment);}, m_maxTriesToConnect);
}
void createTape(const common::dataStructures::SecurityIdentity &admin, const common::dataStructures::Tape & tape) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createTape(admin, tape);}, m_maxTriesToConnect);
}
......
This diff is collapsed.
......@@ -42,7 +42,6 @@ public:
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"); }
void createRequesterMountRule(const common::dataStructures::SecurityIdentity& admin, const std::string& mountPolicyName, const std::string& diskInstance, const std::string& requesterName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createStorageClass(const common::dataStructures::SecurityIdentity& admin, const common::dataStructures::StorageClass& storageClass) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createTape(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const std::string &mediaType, const std::string &vendor, const std::string& logicalLibraryName, const std::string& tapePoolName, const uint64_t capacityInBytes, const bool disabled, const bool full, const bool readOnly, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createTape(const common::dataStructures::SecurityIdentity& admin, const common::dataStructures::Tape & tape) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createMediaType(const common::dataStructures::SecurityIdentity &admin, const MediaType &mediaType) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteMediaType(const std::string &name) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......
......@@ -2916,11 +2916,6 @@ void RdbmsCatalogue::setLogicalLibraryDisabled(const common::dataStructures::Sec
}
}
void RdbmsCatalogue::createTape(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const std::string& mediaType, const std::string& vendor, const std::string& logicalLibraryName, const std::string& tapePoolName, const uint64_t capacityInBytes, const bool disabled, const bool full, const bool readOnly, const std::string& comment){
auto tape = cta::common::dataStructures::Tape::TapeFactory::createTape(vid,mediaType,vendor,logicalLibraryName,tapePoolName, disabled,full,readOnly,comment);
createTape(admin,tape);
}
//------------------------------------------------------------------------------
// createTape
//------------------------------------------------------------------------------
......
......@@ -450,24 +450,6 @@ public:
void modifyLogicalLibraryComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override;
virtual void setLogicalLibraryDisabled(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const bool disabledValue) override;
/**
* Creates a tape which is assumed to have logical block protection (LBP)
* enabled and isFromCastor disabled.
* TODO THIS METHOD IS DEPRECATED AND SHOULD BE REMOVED. IT IS USED ONLY IN THE UNIT TESTS ! USE THE ONE THAT USES THE TAPE DATASTRUCTURE INSTEAD
*/
void createTape(
const common::dataStructures::SecurityIdentity &admin,
const std::string &vid,
const std::string &mediaType,
const std::string &vendor,
const std::string &logicalLibraryName,
const std::string &tapePoolName,
const uint64_t capacityInBytes,
const bool disabled,
const bool full,
const bool readOnly,
const std::string &comment) override;
/**
* Creates a tape which is assumed to have logical block protection (LBP)
* enabled and isFromCastor disabled.
......
This diff is collapsed.
......@@ -404,8 +404,21 @@ TEST_P(DataTransferSessionTest, DataTransferSessionGooddayRecall) {
bool notDisabled = false;
bool notFull = false;
bool notReadOnly = false;
catalogue.createTape(s_adminOnAdminHost, s_vid, s_mediaType, s_vendor, s_libraryName, s_tapePoolName, capacityInBytes,
notDisabled, notFull, notReadOnly, tapeComment);
{
cta::common::dataStructures::Tape tape;
tape.vid = s_vid;
tape.mediaType = s_mediaType;
tape.vendor = s_vendor;
tape.logicalLibraryName = s_libraryName;
tape.tapePoolName = s_tapePoolName;
tape.capacityInBytes = capacityInBytes;
tape.full = notFull;
tape.disabled = notDisabled;
tape.readOnly = notReadOnly;
tape.comment = tapeComment;
catalogue.createTape(s_adminOnAdminHost, tape);
}
// 6) Prepare files for reading by writing them to the mock system
{
......@@ -588,8 +601,21 @@ TEST_P(DataTransferSessionTest, DataTransferSessionWrongRecall) {
bool notDisabled = false;
bool notFull = false;
bool notReadOnly = false;
catalogue.createTape(s_adminOnAdminHost, s_vid, s_mediaType, s_vendor, s_libraryName, s_tapePoolName, capacityInBytes,
notDisabled, notFull, notReadOnly, tapeComment);
{
cta::common::dataStructures::Tape tape;
tape.vid = s_vid;
tape.mediaType = s_mediaType;
tape.vendor = s_vendor;
tape.logicalLibraryName = s_libraryName;
tape.tapePoolName = s_tapePoolName;
tape.capacityInBytes = capacityInBytes;
tape.full = notFull;
tape.disabled = notDisabled;
tape.readOnly = notReadOnly;
tape.comment = tapeComment;
catalogue.createTape(s_adminOnAdminHost, tape);
}
// 6) Prepare files for reading by writing them to the mock system
{
......@@ -782,8 +808,21 @@ TEST_P(DataTransferSessionTest, DataTransferSessionRAORecall) {
bool notDisabled = false;
bool notFull = false;
bool notReadOnly = false;
catalogue.createTape(s_adminOnAdminHost, s_vid, s_mediaType, s_vendor, s_libraryName, s_tapePoolName, capacityInBytes,
notDisabled, notFull, notReadOnly, tapeComment);
{
cta::common::dataStructures::Tape tape;
tape.vid = s_vid;
tape.mediaType = s_mediaType;
tape.vendor = s_vendor;
tape.logicalLibraryName = s_libraryName;
tape.tapePoolName = s_tapePoolName;
tape.capacityInBytes = capacityInBytes;
tape.full = notFull;
tape.disabled = notDisabled;
tape.readOnly = notReadOnly;
tape.comment = tapeComment;
catalogue.createTape(s_adminOnAdminHost, tape);
}
int MAX_RECALLS = 50;
int MAX_BULK_RECALLS = 31;
......@@ -1000,8 +1039,21 @@ TEST_P(DataTransferSessionTest, DataTransferSessionNoSuchDrive) {
bool notDisabled = false;
bool notFull = false;
bool notReadOnly = false;
catalogue.createTape(s_adminOnAdminHost, s_vid, s_mediaType, s_vendor, s_libraryName, s_tapePoolName, capacityInBytes,
notDisabled, notFull, notReadOnly, tapeComment);
{
cta::common::dataStructures::Tape tape;
tape.vid = s_vid;
tape.mediaType = s_mediaType;
tape.vendor = s_vendor;
tape.logicalLibraryName = s_libraryName;
tape.tapePoolName = s_tapePoolName;
tape.capacityInBytes = capacityInBytes;
tape.full = notFull;
tape.disabled = notDisabled;
tape.readOnly = notReadOnly;
tape.comment = tapeComment;
catalogue.createTape(s_adminOnAdminHost, tape);
}
// 6) Prepare files for reading by writing them to the mock system
{
......@@ -1150,8 +1202,21 @@ TEST_P(DataTransferSessionTest, DataTransferSessionFailtoMount) {
bool notDisabled = false;
bool notFull = false;
bool notReadOnly = false;
catalogue.createTape(s_adminOnAdminHost, s_vid, s_mediaType, s_vendor, s_libraryName, s_tapePoolName, capacityInBytes,
notDisabled, notFull, notReadOnly, tapeComment);
{
cta::common::dataStructures::Tape tape;
tape.vid = s_vid;
tape.mediaType = s_mediaType;
tape.vendor = s_vendor;
tape.logicalLibraryName = s_libraryName;
tape.tapePoolName = s_tapePoolName;
tape.capacityInBytes = capacityInBytes;
tape.full = notFull;
tape.disabled = notDisabled;
tape.readOnly = notReadOnly;
tape.comment = tapeComment;
catalogue.createTape(s_adminOnAdminHost, tape);
}
// 6) Prepare files for reading by writing them to the mock system
{
......@@ -1310,9 +1375,22 @@ TEST_P(DataTransferSessionTest, DataTransferSessionGooddayMigration) {
bool notDisabled = false;
bool notFull = false;
bool notReadOnly = false;
catalogue.createTape(s_adminOnAdminHost, s_vid, s_mediaType, s_vendor, s_libraryName, s_tapePoolName, capacityInBytes,
notDisabled, notFull, notReadOnly, tapeComment);
{
cta::common::dataStructures::Tape tape;
tape.vid = s_vid;
tape.mediaType = s_mediaType;
tape.vendor = s_vendor;
tape.logicalLibraryName = s_libraryName;
tape.tapePoolName = s_tapePoolName;
tape.capacityInBytes = capacityInBytes;
tape.full = notFull;
tape.disabled = notDisabled;
tape.readOnly = notReadOnly;
tape.comment = tapeComment;
catalogue.createTape(s_adminOnAdminHost, tape);
}
// Create the mount criteria
catalogue.createMountPolicy(requester, "immediateMount", 1000, 0, 1000, 0, 1, "Policy comment");
catalogue.createRequesterMountRule(requester, "immediateMount", s_diskInstance, requester.username, "Rule comment");
......@@ -1458,9 +1536,22 @@ TEST_P(DataTransferSessionTest, DataTransferSessionMissingFilesMigration) {
bool notDisabled = false;
bool notFull = false;
bool notReadOnly = false;
catalogue.createTape(s_adminOnAdminHost, s_vid, s_mediaType, s_vendor, s_libraryName, s_tapePoolName, capacityInBytes,
notDisabled, notFull, notReadOnly, tapeComment);
{
cta::common::dataStructures::Tape tape;
tape.vid = s_vid;
tape.mediaType = s_mediaType;
tape.vendor = s_vendor;
tape.logicalLibraryName = s_libraryName;
tape.tapePoolName = s_tapePoolName;
tape.capacityInBytes = capacityInBytes;
tape.full = notFull;
tape.disabled = notDisabled;
tape.readOnly = notReadOnly;
tape.comment = tapeComment;
catalogue.createTape(s_adminOnAdminHost, tape);
}
// Create the mount criteria
catalogue.createMountPolicy(requester, "immediateMount", 1000, 0, 1000, 0, 1, "Policy comment");
catalogue.createRequesterMountRule(requester, "immediateMount", s_diskInstance, requester.username, "Rule comment");
......@@ -1620,8 +1711,21 @@ TEST_P(DataTransferSessionTest, DataTransferSessionTapeFullMigration) {
bool notDisabled = false;
bool notFull = false;
bool notReadOnly = false;
catalogue.createTape(s_adminOnAdminHost, s_vid, s_mediaType, s_vendor, s_libraryName, s_tapePoolName, capacityInBytes,
notDisabled, notFull, notReadOnly, tapeComment);
{
cta::common::dataStructures::Tape tape;
tape.vid = s_vid;
tape.mediaType = s_mediaType;
tape.vendor = s_vendor;
tape.logicalLibraryName = s_libraryName;
tape.tapePoolName = s_tapePoolName;
tape.capacityInBytes = capacityInBytes;
tape.full = notFull;
tape.disabled = notDisabled;
tape.readOnly = notReadOnly;
tape.comment = tapeComment;
catalogue.createTape(s_adminOnAdminHost, tape);
}
// Create the mount criteria
catalogue.createMountPolicy(requester, "immediateMount", 1000, 0, 1000, 0, 1, "Policy comment");
......@@ -1782,9 +1886,22 @@ TEST_P(DataTransferSessionTest, DataTransferSessionTapeFullOnFlushMigration) {
bool notDisabled = false;
bool notFull = false;
bool notReadOnly = false;
catalogue.createTape(s_adminOnAdminHost, s_vid, s_mediaType, s_vendor, s_libraryName, s_tapePoolName, capacityInBytes,
notDisabled, notFull, notReadOnly, tapeComment);
{
cta::common::dataStructures::Tape tape;
tape.vid = s_vid;
tape.mediaType = s_mediaType;
tape.vendor = s_vendor;
tape.logicalLibraryName = s_libraryName;
tape.tapePoolName = s_tapePoolName;
tape.capacityInBytes = capacityInBytes;
tape.full = notFull;
tape.disabled = notDisabled;
tape.readOnly = notReadOnly;
tape.comment = tapeComment;
catalogue.createTape(s_adminOnAdminHost, tape);
}
// Create the mount criteria
catalogue.createMountPolicy(requester, "immediateMount", 1000, 0, 1000, 0, 1, "Policy comment");
catalogue.createRequesterMountRule(requester, "immediateMount", s_diskInstance, requester.username, "Rule comment");
......
......@@ -146,8 +146,21 @@ const uint32_t TEST_GROUP_2 = 9754;
m_catalogue->createLogicalLibrary(admin, logicalLibraryName, logicalLibraryIsDisabled, "Create logical library");
m_catalogue->createTapePool(admin, tapePoolName, vo.name, 2, true, supply, "Create tape pool");
createMediaType(mediaType);
m_catalogue->createTape(admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes,
disabledValue, fullValue, readOnlyValue, createTapeComment);
{
cta::common::dataStructures::Tape tape;
tape.vid = vid1;
tape.mediaType = mediaType;
tape.vendor = vendor;
tape.logicalLibraryName = logicalLibraryName;
tape.tapePoolName = tapePoolName;
tape.capacityInBytes = capacityInBytes;
tape.full = fullValue;
tape.disabled = disabledValue;
tape.readOnly = readOnlyValue;
tape.comment = createTapeComment;
m_catalogue->createTape(admin, tape);
}
cta::common::dataStructures::StorageClass storageClass;
......@@ -300,8 +313,21 @@ const uint32_t TEST_GROUP_2 = 9754;
m_catalogue->createLogicalLibrary(admin, logicalLibraryName, logicalLibraryIsDisabled, "Create logical library");
m_catalogue->createTapePool(admin, tapePoolName, vo.name, nbPartialTapes, isEncrypted, supply, "Create tape pool");
createMediaType(mediaType);
m_catalogue->createTape(admin, vid1, mediaType, vendor, logicalLibraryName, tapePoolName, capacityInBytes,
disabledValue, fullValue, readOnlyValue, createTapeComment);
{
cta::common::dataStructures::Tape tape;
tape.vid = vid1;
tape.mediaType = mediaType;
tape.vendor = vendor;
tape.logicalLibraryName = logicalLibraryName;
tape.tapePoolName = tapePoolName;
tape.capacityInBytes = capacityInBytes;
tape.full = fullValue;
tape.disabled = disabledValue;
tape.readOnly = readOnlyValue;
tape.comment = createTapeComment;
m_catalogue->createTape(admin, tape);
}
cta::common::dataStructures::StorageClass storageClass;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment