Commit a36ace67 authored by Cedric Caffy's avatar Cedric Caffy
Browse files

[tape-lifecycle] Removed the tape readonly concept

parent f2c50fb2
......@@ -182,7 +182,7 @@ CREATE TABLE TAPE(
MASTER_DATA_IN_BYTES BIGINT UNSIGNED DEFAULT 0 CONSTRAINT TAPE_MASTER_DATA_IN_BYTES_NN NOT NULL,
IS_DISABLED CHAR(1),
IS_FULL CHAR(1) CONSTRAINT TAPE_IF_NN NOT NULL,
IS_READ_ONLY CHAR(1) CONSTRAINT TAPE_IRO_NN NOT NULL,
IS_READ_ONLY CHAR(1),
IS_FROM_CASTOR CHAR(1) CONSTRAINT TAPE_IFC_NN NOT NULL,
DIRTY CHAR(1) DEFAULT '1' CONSTRAINT TAPE_DIRTY_NN NOT NULL,
NB_COPY_NB_1 BIGINT UNSIGNED DEFAULT 0 CONSTRAINT TAPE_NB_COPY_NB_1_NN NOT NULL,
......
......@@ -214,7 +214,7 @@ CREATE TABLE TAPE(
MASTER_DATA_IN_BYTES NUMERIC(20, 0) DEFAULT 0 CONSTRAINT TAPE_MASTER_DATA_IN_BYTES_NN NOT NULL,
IS_DISABLED CHAR(1),
IS_FULL CHAR(1) CONSTRAINT TAPE_IF_NN NOT NULL,
IS_READ_ONLY CHAR(1) CONSTRAINT TAPE_IRO_NN NOT NULL,
IS_READ_ONLY CHAR(1),
IS_FROM_CASTOR CHAR(1) CONSTRAINT TAPE_IFC_NN NOT NULL,
DIRTY CHAR(1) DEFAULT '1' CONSTRAINT TAPE_DIRTY_NN NOT NULL,
NB_COPY_NB_1 NUMERIC(20, 0) DEFAULT 0 CONSTRAINT TAPE_NB_COPY_NB_1_NN NOT NULL,
......
......@@ -196,7 +196,7 @@ CREATE TABLE TAPE(
MASTER_DATA_IN_BYTES NUMERIC(20, 0) DEFAULT 0 CONSTRAINT TAPE_MASTER_DATA_IN_BYTES_NN NOT NULL,
IS_DISABLED CHAR(1),
IS_FULL CHAR(1) CONSTRAINT TAPE_IF_NN NOT NULL,
IS_READ_ONLY CHAR(1) CONSTRAINT TAPE_IRO_NN NOT NULL,
IS_READ_ONLY CHAR(1),
IS_FROM_CASTOR CHAR(1) CONSTRAINT TAPE_IFC_NN NOT NULL,
DIRTY CHAR(1) DEFAULT '1' CONSTRAINT TAPE_DIRTY_NN NOT NULL,
NB_COPY_NB_1 NUMERIC(20, 0) DEFAULT 0 CONSTRAINT TAPE_NB_COPY_NB_1_NN NOT NULL,
......
......@@ -168,7 +168,7 @@ CREATE TABLE TAPE(
MASTER_DATA_IN_BYTES INTEGER DEFAULT 0 CONSTRAINT TAPE_MASTER_DATA_IN_BYTES_NN NOT NULL,
IS_DISABLED CHAR(1),
IS_FULL CHAR(1) CONSTRAINT TAPE_IF_NN NOT NULL,
IS_READ_ONLY CHAR(1) CONSTRAINT TAPE_IRO_NN NOT NULL,
IS_READ_ONLY CHAR(1),
IS_FROM_CASTOR CHAR(1) CONSTRAINT TAPE_IFC_NN NOT NULL,
DIRTY CHAR(1) DEFAULT '1' CONSTRAINT TAPE_DIRTY_NN NOT NULL,
NB_COPY_NB_1 INTEGER DEFAULT 0 CONSTRAINT TAPE_NB_COPY_NB_1_NN NOT NULL,
......
......@@ -7172,7 +7172,7 @@ namespace catalogue{
" MASTER_DATA_IN_BYTES NUMERIC(20, 0) DEFAULT 0 CONSTRAINT TAPE_MASTER_DATA_IN_BYTES_NN NOT NULL,"
" IS_DISABLED CHAR(1),"
" IS_FULL CHAR(1) CONSTRAINT TAPE_IF_NN NOT NULL,"
" IS_READ_ONLY CHAR(1) CONSTRAINT TAPE_IRO_NN NOT NULL,"
" IS_READ_ONLY CHAR(1),"
" IS_FROM_CASTOR CHAR(1) CONSTRAINT TAPE_IFC_NN NOT NULL,"
" DIRTY CHAR(1) DEFAULT '1' CONSTRAINT TAPE_DIRTY_NN NOT NULL,"
" NB_COPY_NB_1 NUMERIC(20, 0) DEFAULT 0 CONSTRAINT TAPE_NB_COPY_NB_1_NN NOT NULL,"
......@@ -7594,7 +7594,7 @@ namespace catalogue{
" MASTER_DATA_IN_BYTES BIGINT UNSIGNED DEFAULT 0 CONSTRAINT TAPE_MASTER_DATA_IN_BYTES_NN NOT NULL,"
" IS_DISABLED CHAR(1),"
" IS_FULL CHAR(1) CONSTRAINT TAPE_IF_NN NOT NULL,"
" IS_READ_ONLY CHAR(1) CONSTRAINT TAPE_IRO_NN NOT NULL,"
" IS_READ_ONLY CHAR(1),"
" IS_FROM_CASTOR CHAR(1) CONSTRAINT TAPE_IFC_NN NOT NULL,"
" DIRTY CHAR(1) DEFAULT '1' CONSTRAINT TAPE_DIRTY_NN NOT NULL,"
" NB_COPY_NB_1 BIGINT UNSIGNED DEFAULT 0 CONSTRAINT TAPE_NB_COPY_NB_1_NN NOT NULL,"
......@@ -8001,7 +8001,7 @@ namespace catalogue{
" MASTER_DATA_IN_BYTES INTEGER DEFAULT 0 CONSTRAINT TAPE_MASTER_DATA_IN_BYTES_NN NOT NULL,"
" IS_DISABLED CHAR(1),"
" IS_FULL CHAR(1) CONSTRAINT TAPE_IF_NN NOT NULL,"
" IS_READ_ONLY CHAR(1) CONSTRAINT TAPE_IRO_NN NOT NULL,"
" IS_READ_ONLY CHAR(1),"
" IS_FROM_CASTOR CHAR(1) CONSTRAINT TAPE_IFC_NN NOT NULL,"
" DIRTY CHAR(1) DEFAULT '1' CONSTRAINT TAPE_DIRTY_NN NOT NULL,"
" NB_COPY_NB_1 INTEGER DEFAULT 0 CONSTRAINT TAPE_NB_COPY_NB_1_NN NOT NULL,"
......@@ -8434,7 +8434,7 @@ namespace catalogue{
" MASTER_DATA_IN_BYTES NUMERIC(20, 0) DEFAULT 0 CONSTRAINT TAPE_MASTER_DATA_IN_BYTES_NN NOT NULL,"
" IS_DISABLED CHAR(1),"
" IS_FULL CHAR(1) CONSTRAINT TAPE_IF_NN NOT NULL,"
" IS_READ_ONLY CHAR(1) CONSTRAINT TAPE_IRO_NN NOT NULL,"
" IS_READ_ONLY CHAR(1),"
" IS_FROM_CASTOR CHAR(1) CONSTRAINT TAPE_IFC_NN NOT NULL,"
" DIRTY CHAR(1) DEFAULT '1' CONSTRAINT TAPE_DIRTY_NN NOT NULL,"
" NB_COPY_NB_1 NUMERIC(20, 0) DEFAULT 0 CONSTRAINT TAPE_NB_COPY_NB_1_NN NOT NULL,"
......
......@@ -630,26 +630,6 @@ public:
*/
virtual void setTapeFull(const common::dataStructures::SecurityIdentity &admin, const std::string &vid, const bool fullValue) = 0;
/**
* Sets the read-only status of the specified tape.
*
* Please note that this method is to be called by the CTA front-end in
* response to a command from the CTA command-line interface (CLI).
*
* @param admin The administrator.
* @param vid The volume identifier of the tape to be marked as read-only.
* @param readOnlyValue Set to true if the tape is read-only.
*/
virtual void setTapeReadOnly(const common::dataStructures::SecurityIdentity &admin, const std::string &vid, const bool readOnlyValue) = 0;
/**
* This method notifies the CTA catalogue to set the specified tape read-only
* in case of a problem.
*
* @param vid The volume identifier of the tape.
*/
virtual void setTapeReadOnlyOnError(const std::string &vid) = 0;
/**
* This method notifies the CTA catalogue to set the specified tape is from CASTOR.
* This method only for unitTests and MUST never be called in CTA!!!
......
......@@ -363,14 +363,6 @@ public:
void setTapeFull(const common::dataStructures::SecurityIdentity &admin, const std::string &vid, const bool fullValue) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->setTapeFull(admin, vid, fullValue);}, m_maxTriesToConnect);
}
void setTapeReadOnly(const common::dataStructures::SecurityIdentity &admin, const std::string &vid, const bool readOnlyValue) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->setTapeReadOnly(admin, vid, readOnlyValue);}, m_maxTriesToConnect);
}
void setTapeReadOnlyOnError(const std::string &vid) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->setTapeReadOnlyOnError(vid);}, m_maxTriesToConnect);
}
void setTapeIsFromCastorInUnitTests(const std::string &vid) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->setTapeIsFromCastorInUnitTests(vid);}, m_maxTriesToConnect);
......
This diff is collapsed.
......@@ -61,12 +61,6 @@ struct CreateTapeAttributes {
*/
bool full;
/**
* True if the tape is read-only.
*/
bool readOnly;
/**
* Optional comment about the tape.
*/
......@@ -88,8 +82,7 @@ struct CreateTapeAttributes {
* Sets the value of all boolean member-variables to false.
*/
CreateTapeAttributes():
full(false),
readOnly(false) {
full(false) {
}
}; // struct CreateTapeAttributes
......
......@@ -153,8 +153,6 @@ public:
void setTapeDisabled(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const std::string & reason) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void setTapeFull(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const bool fullValue) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void setTapeDirty(const std::string & vid) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void setTapeReadOnly(const common::dataStructures::SecurityIdentity &admin, const std::string &vid, const bool readOnlyValue) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void setTapeReadOnlyOnError(const std::string &vid) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void setTapeIsFromCastorInUnitTests(const std::string &vid) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void setTapePoolEncryption(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const bool encryptionValue) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
bool tapeExists(const std::string& vid) const { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......
......@@ -3162,7 +3162,6 @@ void RdbmsCatalogue::createTape(
std::string logicalLibraryName = tape.logicalLibraryName;
std::string tapePoolName = tape.tapePoolName;
bool full = tape.full;
bool readOnly = tape.readOnly;
// Translate an empty comment string to a NULL database value
const optional<std::string> tapeComment = tape.comment && tape.comment->empty() ? nullopt : tape.comment;
const optional<std::string> stateReason = tape.stateReason && cta::utils::trimString(tape.stateReason.value()).empty() ? nullopt : tape.stateReason;
......@@ -3234,7 +3233,6 @@ void RdbmsCatalogue::createTape(
"DATA_IN_BYTES," "\n"
"LAST_FSEQ," "\n"
"IS_FULL," "\n"
"IS_READ_ONLY," "\n"
"IS_FROM_CASTOR," "\n"
"USER_COMMENT," "\n"
......@@ -3260,7 +3258,6 @@ void RdbmsCatalogue::createTape(
":DATA_IN_BYTES," "\n"
":LAST_FSEQ," "\n"
":IS_FULL," "\n"
":IS_READ_ONLY," "\n"
":IS_FROM_CASTOR," "\n"
":USER_COMMENT," "\n"
......@@ -3288,7 +3285,6 @@ void RdbmsCatalogue::createTape(
stmt.bindUint64(":DATA_IN_BYTES", 0);
stmt.bindUint64(":LAST_FSEQ", 0);
stmt.bindBool(":IS_FULL", full);
stmt.bindBool(":IS_READ_ONLY", readOnly);
stmt.bindBool(":IS_FROM_CASTOR", isFromCastor);
stmt.bindString(":USER_COMMENT", tapeComment);
......@@ -3317,7 +3313,6 @@ void RdbmsCatalogue::createTape(
.add("logicalLibraryName", logicalLibraryName)
.add("tapePoolName", tapePoolName)
.add("isFull", full ? 1 : 0)
.add("isReadOnly", readOnly ? 1 : 0)
.add("isFromCastor", isFromCastor ? 1 : 0)
.add("userComment", tape.comment ? tape.comment.value() : "")
.add("tapeState",cta::common::dataStructures::Tape::stateToString(tape.state))
......@@ -3496,7 +3491,6 @@ std::list<common::dataStructures::Tape> RdbmsCatalogue::getTapes(rdbms::Conn &co
"TAPE.MASTER_DATA_IN_BYTES AS MASTER_DATA_IN_BYTES,"
"TAPE.LAST_FSEQ AS LAST_FSEQ,"
"TAPE.IS_FULL AS IS_FULL,"
"TAPE.IS_READ_ONLY AS IS_READ_ONLY,"
"TAPE.IS_FROM_CASTOR AS IS_FROM_CASTOR,"
"TAPE.LABEL_DRIVE AS LABEL_DRIVE,"
......@@ -3544,7 +3538,6 @@ std::list<common::dataStructures::Tape> RdbmsCatalogue::getTapes(rdbms::Conn &co
searchCriteria.vo ||
searchCriteria.capacityInBytes ||
searchCriteria.full ||
searchCriteria.readOnly ||
searchCriteria.diskFileIds ||
searchCriteria.state) {
sql += " WHERE";
......@@ -3591,11 +3584,6 @@ std::list<common::dataStructures::Tape> RdbmsCatalogue::getTapes(rdbms::Conn &co
sql += " TAPE.IS_FULL = :IS_FULL";
addedAWhereConstraint = true;
}
if(searchCriteria.readOnly) {
if(addedAWhereConstraint) sql += " AND ";
sql += " TAPE.IS_READ_ONLY = :IS_READ_ONLY";
addedAWhereConstraint = true;
}
if(searchCriteria.diskFileIds) {
if(addedAWhereConstraint) sql += " AND ";
sql += " VID IN ("
......@@ -3628,7 +3616,6 @@ std::list<common::dataStructures::Tape> RdbmsCatalogue::getTapes(rdbms::Conn &co
if(searchCriteria.vo) stmt.bindString(":VO", searchCriteria.vo.value());
if(searchCriteria.capacityInBytes) stmt.bindUint64(":CAPACITY_IN_BYTES", searchCriteria.capacityInBytes.value());
if(searchCriteria.full) stmt.bindBool(":IS_FULL", searchCriteria.full.value());
if(searchCriteria.readOnly) stmt.bindBool(":IS_READ_ONLY", searchCriteria.readOnly.value());
try{
if(searchCriteria.state) stmt.bindString(":TAPE_STATE",cta::common::dataStructures::Tape::stateToString(searchCriteria.state.value()));
} catch(cta::exception::Exception &ex){
......@@ -3667,7 +3654,6 @@ std::list<common::dataStructures::Tape> RdbmsCatalogue::getTapes(rdbms::Conn &co
tape.masterDataInBytes = rset.columnUint64("MASTER_DATA_IN_BYTES");
tape.lastFSeq = rset.columnUint64("LAST_FSEQ");
tape.full = rset.columnBool("IS_FULL");
tape.readOnly = rset.columnBool("IS_READ_ONLY");
tape.isFromCastor = rset.columnBool("IS_FROM_CASTOR");
tape.labelLog = getTapeLogFromRset(rset, "LABEL_DRIVE", "LABEL_TIME");
......@@ -3795,8 +3781,7 @@ std::string RdbmsCatalogue::getSelectTapesBy100VidsSql() const {
"TAPE.DATA_IN_BYTES AS DATA_IN_BYTES,"
"TAPE.LAST_FSEQ AS LAST_FSEQ,"
"TAPE.IS_FULL AS IS_FULL,"
"TAPE.IS_READ_ONLY AS IS_READ_ONLY,"
"TAPE.IS_FROM_CASTOR AS IS_FROM_CASTOR,"
"TAPE.IS_FROM_CASTOR AS IS_FROM_CASTOR,"
"TAPE.LABEL_DRIVE AS LABEL_DRIVE,"
"TAPE.LABEL_TIME AS LABEL_TIME,"
......@@ -3866,7 +3851,6 @@ void RdbmsCatalogue::executeGetTapesBy100VidsStmtAndCollectResults(rdbms::Stmt &
tape.dataOnTapeInBytes = rset.columnUint64("DATA_IN_BYTES");
tape.lastFSeq = rset.columnUint64("LAST_FSEQ");
tape.full = rset.columnBool("IS_FULL");
tape.readOnly = rset.columnBool("IS_READ_ONLY");
tape.isFromCastor = rset.columnBool("IS_FROM_CASTOR");
tape.labelLog = getTapeLogFromRset(rset, "LABEL_DRIVE", "LABEL_TIME");
tape.lastReadLog = getTapeLogFromRset(rset, "LAST_READ_DRIVE", "LAST_READ_TIME");
......@@ -3960,6 +3944,7 @@ std::map<std::string, std::string> RdbmsCatalogue::getVidToLogicalLibrary(const
}
}
//------------------------------------------------------------------------------
// getSelectVidToLogicalLibraryBy100Sql
//------------------------------------------------------------------------------
......@@ -4685,83 +4670,6 @@ void RdbmsCatalogue::noSpaceLeftOnTape(const std::string &vid) {
}
}
//------------------------------------------------------------------------------
// setTapeReadOnly
//------------------------------------------------------------------------------
void RdbmsCatalogue::setTapeReadOnly(const common::dataStructures::SecurityIdentity &admin, const std::string &vid,
const bool readOnlyValue) {
try {
const time_t now = time(nullptr);
const char *const sql =
"UPDATE TAPE SET "
"IS_READ_ONLY = :IS_READ_ONLY,"
"LAST_UPDATE_USER_NAME = :LAST_UPDATE_USER_NAME,"
"LAST_UPDATE_HOST_NAME = :LAST_UPDATE_HOST_NAME,"
"LAST_UPDATE_TIME = :LAST_UPDATE_TIME "
"WHERE "
"VID = :VID";
auto conn = m_connPool.getConn();
auto stmt = conn.createStmt(sql);
stmt.bindBool(":IS_READ_ONLY", readOnlyValue);
stmt.bindString(":LAST_UPDATE_USER_NAME", admin.username);
stmt.bindString(":LAST_UPDATE_HOST_NAME", admin.host);
stmt.bindUint64(":LAST_UPDATE_TIME", now);
stmt.bindString(":VID", vid);
stmt.executeNonQuery();
if(0 == stmt.getNbAffectedRows()) {
throw exception::UserError(std::string("Cannot modify tape ") + vid + " because it does not exist");
}
log::LogContext lc(m_log);
log::ScopedParamContainer spc(lc);
spc.add("vid", vid)
.add("isReadOnly", readOnlyValue ? 1 : 0)
.add("lastUpdateUserName", admin.username)
.add("lastUpdateHostName", admin.host)
.add("lastUpdateTime", now);
lc.log(log::INFO, "Catalogue - user modified tape - isReadOnly");
} catch(exception::UserError &) {
throw;
} catch(exception::Exception &ex) {
ex.getMessage().str(std::string(__FUNCTION__) + ": " + ex.getMessage().str());
throw;
}
}
//------------------------------------------------------------------------------
// setTapeReadOnlyOnError
//------------------------------------------------------------------------------
void RdbmsCatalogue::setTapeReadOnlyOnError(const std::string &vid) {
try {
const char *const sql =
"UPDATE TAPE SET "
"IS_READ_ONLY = '1' "
"WHERE "
"VID = :VID";
auto conn = m_connPool.getConn();
auto stmt = conn.createStmt(sql);
stmt.bindString(":VID", vid);
stmt.executeNonQuery();
if (0 == stmt.getNbAffectedRows()) {
throw exception::Exception(std::string("Tape ") + vid + " does not exist");
}
log::LogContext lc(m_log);
log::ScopedParamContainer spc(lc);
spc.add("vid", vid)
.add("isReadOnly", 1)
.add("method", "setTapeReadOnlyOnError");
lc.log(log::INFO, "Catalogue - system modified tape - isReadOnly");
} catch(exception::UserError &) {
throw;
} catch(exception::Exception &ex) {
ex.getMessage().str(std::string(__FUNCTION__) + ": " + ex.getMessage().str());
throw;
}
}
//------------------------------------------------------------------------------
// setTapeIsFromCastorInUnitTests
//------------------------------------------------------------------------------
......@@ -7732,7 +7640,6 @@ std::list<TapeForWriting> RdbmsCatalogue::getTapesForWriting(const std::string &
// "TAPE.LABEL_TIME IS NOT NULL AND " // Set when the tape has been labelled
"TAPE.TAPE_STATE = :TAPE_STATE AND "
"TAPE.IS_FULL = '0' AND "
"TAPE.IS_READ_ONLY = '0' AND "
"TAPE.IS_FROM_CASTOR = '0' AND "
"LOGICAL_LIBRARY.LOGICAL_LIBRARY_NAME = :LOGICAL_LIBRARY_NAME "
"ORDER BY TAPE.DATA_IN_BYTES DESC";
......
......@@ -592,26 +592,6 @@ public:
*/
void setTapeFull(const common::dataStructures::SecurityIdentity &admin, const std::string &vid, const bool fullValue) override;
/**
* Sets the read-only status of the specified tape.
*
* Please note that this method is to be called by the CTA front-end in
* response to a command from the CTA command-line interface (CLI).
*
* @param admin The administrator.
* @param vid The volume identifier of the tape to be marked as read-only.
* @param readOnlyValue Set to true if the tape is read-only.
*/
void setTapeReadOnly(const common::dataStructures::SecurityIdentity &admin, const std::string &vid, const bool readOnlyValue) override;
/**
* This method notifies the CTA catalogue to set the specified tape read-only
* in case of a problem.
*
* @param vid The volume identifier of the tape.
*/
void setTapeReadOnlyOnError(const std::string &vid) override;
/**
* This method notifies the CTA catalogue to set the specified tape is from CASTOR.
* This method only for unitTests and MUST never be called in CTA!!!
......
......@@ -76,11 +76,6 @@ struct TapeSearchCriteria {
* Set to true if searching for full tapes.
*/
optional<bool> full;
/**
* Set to true if searching for read-only tapes.
*/
optional<bool> readOnly;
/**
* List of disk file IDs to search for.
......
......@@ -147,7 +147,7 @@ CREATE TABLE TAPE(
MASTER_DATA_IN_BYTES UINT64TYPE DEFAULT 0 CONSTRAINT TAPE_MASTER_DATA_IN_BYTES_NN NOT NULL,
IS_DISABLED CHAR(1),
IS_FULL CHAR(1) CONSTRAINT TAPE_IF_NN NOT NULL,
IS_READ_ONLY CHAR(1) CONSTRAINT TAPE_IRO_NN NOT NULL,
IS_READ_ONLY CHAR(1),
IS_FROM_CASTOR CHAR(1) CONSTRAINT TAPE_IFC_NN NOT NULL,
DIRTY CHAR(1) DEFAULT '1' CONSTRAINT TAPE_DIRTY_NN NOT NULL,
NB_COPY_NB_1 UINT64TYPE DEFAULT 0 CONSTRAINT TAPE_NB_COPY_NB_1_NN NOT NULL,
......
......@@ -240,6 +240,11 @@ ALTER TABLE TAPE DROP CONSTRAINT TAPE_ID_NN;
--changeset ccaffy:18 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.1" 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 TAPE DROP CONSTRAINT TAPE_IRO_NN;
--changeset ccaffy:19 failOnError:true dbms:oracle
--preconditions onFail:HALT onError:HALT
--precondition-sql-check expectedResult:"3.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 STATUS='PRODUCTION';
UPDATE CTA_CATALOGUE SET SCHEMA_VERSION_MAJOR=3;
UPDATE CTA_CATALOGUE SET SCHEMA_VERSION_MINOR=2;
......
......@@ -254,7 +254,6 @@ const std::map<std::string, OptionBoolean::Key> boolOptions = {
{ "--encrypted", OptionBoolean::ENCRYPTED },
{ "--force", OptionBoolean::FORCE },
{ "--full", OptionBoolean::FULL },
{ "--readonly", OptionBoolean::READ_ONLY },
// hasOption options
{ "--disabledtape", OptionBoolean::DISABLED },
......@@ -465,7 +464,6 @@ const Option opt_vid { Option::OPT_STR, "--vid",
const Option opt_vo { Option::OPT_STR, "--vo", "--vo", " <vo>" };
const Option opt_vidfile { Option::OPT_STR_LIST, "--vidfile", "-f", " <filename>" };
const Option opt_full { Option::OPT_BOOL, "--full", "-f", " <\"true\" or \"false\">" };
const Option opt_readonly { Option::OPT_BOOL, "--readonly", "-r", " <\"true\" or \"false\">" };
const Option opt_disabled_tape { Option::OPT_FLAG, "--disabledtape", "-d", "" };
const Option opt_disksystem { Option::OPT_STR, "--disksystem", "-n", " <disk_system_name>" };
const Option opt_file_regexp { Option::OPT_STR, "--fileregexp", "-r", " <file_regexp>" };
......@@ -560,18 +558,18 @@ const std::map<cmd_key_t, cmd_val_t> cmdOptions = {
{{ AdminCmd::CMD_STORAGECLASS, AdminCmd::SUBCMD_LS }, { }},
/*----------------------------------------------------------------------------------------------------*/
{{ AdminCmd::CMD_TAPE, AdminCmd::SUBCMD_ADD },
{ opt_vid, opt_mediatype, opt_vendor, opt_logicallibrary, opt_tapepool, opt_full, opt_readonly,
{ opt_vid, opt_mediatype, opt_vendor, opt_logicallibrary, opt_tapepool, opt_full,
opt_state.optional(), opt_reason.optional(), opt_comment.optional() }},
{{ AdminCmd::CMD_TAPE, AdminCmd::SUBCMD_CH },
{ opt_vid, opt_mediatype.optional(), opt_vendor.optional(), opt_logicallibrary.optional(),
opt_tapepool.optional(), opt_encryptionkeyname.optional(),
opt_full.optional(), opt_readonly.optional(), opt_state.optional(), opt_reason.optional(), opt_comment.optional() }},
opt_full.optional(), opt_state.optional(), opt_reason.optional(), opt_comment.optional() }},
{{ AdminCmd::CMD_TAPE, AdminCmd::SUBCMD_RM }, { opt_vid }},
{{ AdminCmd::CMD_TAPE, AdminCmd::SUBCMD_RECLAIM }, { opt_vid }},
{{ AdminCmd::CMD_TAPE, AdminCmd::SUBCMD_LS },
{ opt_vid.optional(), opt_mediatype.optional(), opt_vendor.optional(),
opt_logicallibrary.optional(), opt_tapepool.optional(), opt_vo.optional(), opt_capacity.optional(),
opt_full.optional(), opt_readonly.optional(), opt_fidfile.optional(), opt_all.optional(), opt_state.optional() }},
opt_full.optional(), opt_fidfile.optional(), opt_all.optional(), opt_state.optional() }},
{{ AdminCmd::CMD_TAPE, AdminCmd::SUBCMD_LABEL },
{ opt_vid, opt_force.optional() }},
/*----------------------------------------------------------------------------------------------------*/
......
......@@ -697,7 +697,6 @@ void TextFormatter::printShowQueuesHeader() {
"full tapes",
"empty tapes",
"disabled tapes",
"rdonly tapes",
"writable tapes"
);
}
......@@ -736,7 +735,6 @@ void TextFormatter::print(const ShowQueuesItem &sq_item) {
sq_item.full_tapes(),
sq_item.empty_tapes(),
sq_item.disabled_tapes(),
sq_item.rdonly_tapes(),
sq_item.writable_tapes()
);
}
......@@ -786,8 +784,6 @@ void TextFormatter::printTapeLsHeader() {
"occupancy",
"last fseq",
"full",
"disabled",
"rdonly",
"from castor",
"state",
"state reason",
......@@ -823,8 +819,6 @@ void TextFormatter::print(const TapeLsItem &tals_item) {
dataSizeToStr(tals_item.occupancy()),
tals_item.last_fseq(),
tals_item.full(),
tals_item.disabled(),
tals_item.rdonly(),
tals_item.from_castor(),
tals_item.state(),
state_reason,
......
......@@ -48,7 +48,6 @@ struct QueueAndMountSummary {
uint64_t filesOnTapes=0;
uint64_t dataOnTapes=0;
uint64_t fullTapes=0;
uint64_t readOnlyTapes=0;
uint64_t emptyTapes=0;
uint64_t disabledTapes=0;
uint64_t writableTapes=0;
......
......@@ -35,7 +35,6 @@ Tape::Tape():
nbMasterFiles(0),
masterDataInBytes(0),
full(false),
readOnly(false),
state(Tape::State::ACTIVE)
{}
......@@ -74,7 +73,6 @@ bool Tape::operator==(const Tape &rhs) const {
&& encryptionKeyName==rhs.encryptionKeyName
&& full==rhs.full
&& state==rhs.state
&& readOnly==rhs.readOnly
&& creationLog==rhs.creationLog
&& lastModificationLog==rhs.lastModificationLog
&& comment==rhs.comment
......@@ -137,8 +135,7 @@ std::ostream &operator<<(std::ostream &os, const Tape &obj) {
<< " capacityInBytes=" << obj.capacityInBytes
<< " dataOnTapeInBytes=" << obj.dataOnTapeInBytes
<< " encryptionKeyName=" << (obj.encryptionKeyName ? obj.encryptionKeyName.value() : "null")
<< " full=" << obj.full
<< " readOnly=" << obj.readOnly
<< " full=" << obj.full
<< " creationLog=" << obj.creationLog
<< " lastModificationLog=" << obj.lastModificationLog
<< " comment=" << obj.comment
......
......@@ -96,7 +96,6 @@ struct Tape {
bool full;
bool disabled;
bool readOnly;
bool isFromCastor;
bool dirty;
uint64_t readMountCount;
......
Supports Markdown
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