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

Renamed the catalogue->deleteArchiveFile() method to

DO_NOT_USE_deleteArchiveFile_DO_NOT_USE()
parent 0b9d801a
...@@ -867,6 +867,7 @@ public: ...@@ -867,6 +867,7 @@ public:
virtual common::dataStructures::ArchiveFile getArchiveFileById(const uint64_t id) = 0; virtual common::dataStructures::ArchiveFile getArchiveFileById(const uint64_t id) = 0;
/** /**
* !!!!!!!!!!!!!!!!!!! THIS METHOD SHOULD NOT BE USED !!!!!!!!!!!!!!!!!!!!!!!
* Deletes the specified archive file and its associated tape copies from the * Deletes the specified archive file and its associated tape copies from the
* catalogue. * catalogue.
* *
...@@ -884,7 +885,7 @@ public: ...@@ -884,7 +885,7 @@ public:
* @return The metadata of the deleted archive file including the metadata of * @return The metadata of the deleted archive file including the metadata of
* the associated and also deleted tape copies. * the associated and also deleted tape copies.
*/ */
virtual void deleteArchiveFile(const std::string &instanceName, const uint64_t archiveFileId, virtual void DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(const std::string &instanceName, const uint64_t archiveFileId,
log::LogContext &lc) = 0; log::LogContext &lc) = 0;
/** /**
......
...@@ -536,8 +536,8 @@ public: ...@@ -536,8 +536,8 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->getArchiveFileById(id);}, m_maxTriesToConnect); return retryOnLostConnection(m_log, [&]{return m_catalogue->getArchiveFileById(id);}, m_maxTriesToConnect);
} }
void deleteArchiveFile(const std::string &instanceName, const uint64_t archiveFileId, log::LogContext &lc) override { void DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(const std::string &instanceName, const uint64_t archiveFileId, log::LogContext &lc) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->deleteArchiveFile(instanceName, archiveFileId, lc);}, m_maxTriesToConnect); return retryOnLostConnection(m_log, [&]{return m_catalogue->DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(instanceName, archiveFileId, lc);}, m_maxTriesToConnect);
} }
bool isAdmin(const common::dataStructures::SecurityIdentity &admin) const override { bool isAdmin(const common::dataStructures::SecurityIdentity &admin) const override {
......
...@@ -144,7 +144,7 @@ void cta_catalogue_CatalogueTest::SetUp() { ...@@ -144,7 +144,7 @@ void cta_catalogue_CatalogueTest::SetUp() {
   
for(const auto &archiveFile: archiveFiles) { for(const auto &archiveFile: archiveFiles) {
log::LogContext dummyLc(m_dummyLog); log::LogContext dummyLc(m_dummyLog);
m_catalogue->deleteArchiveFile(archiveFile.diskInstance, archiveFile.archiveFileID, dummyLc); m_catalogue->DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(archiveFile.diskInstance, archiveFile.archiveFileID, dummyLc);
} }
} }
{ {
...@@ -13590,7 +13590,7 @@ TEST_P(cta_catalogue_CatalogueTest, deleteArchiveFile) { ...@@ -13590,7 +13590,7 @@ TEST_P(cta_catalogue_CatalogueTest, deleteArchiveFile) {
} }
   
log::LogContext dummyLc(m_dummyLog); log::LogContext dummyLc(m_dummyLog);
m_catalogue->deleteArchiveFile("disk_instance", archiveFileId, dummyLc); m_catalogue->DO_NOT_USE_deleteArchiveFile_DO_NOT_USE("disk_instance", archiveFileId, dummyLc);
ASSERT_FALSE(m_catalogue->getArchiveFilesItor().hasMore()); ASSERT_FALSE(m_catalogue->getArchiveFilesItor().hasMore());
} }
...@@ -13898,7 +13898,7 @@ TEST_P(cta_catalogue_CatalogueTest, deleteArchiveFile_by_archive_file_id_of_anot ...@@ -13898,7 +13898,7 @@ TEST_P(cta_catalogue_CatalogueTest, deleteArchiveFile_by_archive_file_id_of_anot
} }
   
log::LogContext dummyLc(m_dummyLog); log::LogContext dummyLc(m_dummyLog);
ASSERT_THROW(m_catalogue->deleteArchiveFile("another_disk_instance", archiveFileId, dummyLc), exception::UserError); ASSERT_THROW(m_catalogue->DO_NOT_USE_deleteArchiveFile_DO_NOT_USE("another_disk_instance", archiveFileId, dummyLc), exception::UserError);
} }
   
TEST_P(cta_catalogue_CatalogueTest, deleteArchiveFile_by_archive_file_id_non_existent) { TEST_P(cta_catalogue_CatalogueTest, deleteArchiveFile_by_archive_file_id_non_existent) {
...@@ -13906,7 +13906,7 @@ TEST_P(cta_catalogue_CatalogueTest, deleteArchiveFile_by_archive_file_id_non_exi ...@@ -13906,7 +13906,7 @@ TEST_P(cta_catalogue_CatalogueTest, deleteArchiveFile_by_archive_file_id_non_exi
   
ASSERT_FALSE(m_catalogue->getArchiveFilesItor().hasMore()); ASSERT_FALSE(m_catalogue->getArchiveFilesItor().hasMore());
log::LogContext dummyLc(m_dummyLog); log::LogContext dummyLc(m_dummyLog);
m_catalogue->deleteArchiveFile("disk_instance", 12345678, dummyLc); m_catalogue->DO_NOT_USE_deleteArchiveFile_DO_NOT_USE("disk_instance", 12345678, dummyLc);
} }
   
TEST_P(cta_catalogue_CatalogueTest, getTapesByVid_non_existent_tape) { TEST_P(cta_catalogue_CatalogueTest, getTapesByVid_non_existent_tape) {
...@@ -15408,7 +15408,7 @@ TEST_P(cta_catalogue_CatalogueTest, checkTapeForLabel_one_tape_file_reclaimed_ta ...@@ -15408,7 +15408,7 @@ TEST_P(cta_catalogue_CatalogueTest, checkTapeForLabel_one_tape_file_reclaimed_ta
ASSERT_THROW(m_catalogue->checkTapeForLabel(vid1), exception::UserError); ASSERT_THROW(m_catalogue->checkTapeForLabel(vid1), exception::UserError);
log::LogContext dummyLc(m_dummyLog); log::LogContext dummyLc(m_dummyLog);
m_catalogue->deleteArchiveFile(diskInstanceName1, archiveFileId, dummyLc); m_catalogue->DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(diskInstanceName1, archiveFileId, dummyLc);
m_catalogue->setTapeFull(m_admin, vid1, true); m_catalogue->setTapeFull(m_admin, vid1, true);
m_catalogue->reclaimTape(m_admin, vid1,dummyLc); m_catalogue->reclaimTape(m_admin, vid1,dummyLc);
...@@ -15955,7 +15955,7 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_full_lastFSeq_1_no_tape_files) { ...@@ -15955,7 +15955,7 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_full_lastFSeq_1_no_tape_files) {
} }
   
{ {
m_catalogue->deleteArchiveFile(diskInstanceName1, file1Written.archiveFileId, dummyLc); m_catalogue->DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(diskInstanceName1, file1Written.archiveFileId, dummyLc);
} }
   
{ {
......
...@@ -59,7 +59,7 @@ public: ...@@ -59,7 +59,7 @@ public:
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 { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } 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 { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
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 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 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 DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(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& 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 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 deleteMountPolicy(const std::string& name) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......
...@@ -463,7 +463,7 @@ void MysqlCatalogue::fileWrittenToTape(rdbms::Conn &conn, const TapeFileWritten ...@@ -463,7 +463,7 @@ void MysqlCatalogue::fileWrittenToTape(rdbms::Conn &conn, const TapeFileWritten
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// deleteArchiveFile // deleteArchiveFile
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void MysqlCatalogue::deleteArchiveFile(const std::string &diskInstanceName, const uint64_t archiveFileId, void MysqlCatalogue::DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(const std::string &diskInstanceName, const uint64_t archiveFileId,
log::LogContext &lc) { log::LogContext &lc) {
try { try {
const char *selectSql = const char *selectSql =
......
...@@ -149,6 +149,7 @@ protected: ...@@ -149,6 +149,7 @@ protected:
void filesWrittenToTape(const std::set<TapeItemWrittenPointer> &events) override; void filesWrittenToTape(const std::set<TapeItemWrittenPointer> &events) override;
/** /**
* !!!!!!!!!!!!!!!!!!! THIS METHOD SHOULD NOT BE USED !!!!!!!!!!!!!!!!!!!!!!!
* Deletes the specified archive file and its associated tape copies from the * Deletes the specified archive file and its associated tape copies from the
* catalogue. * catalogue.
* *
...@@ -166,7 +167,7 @@ protected: ...@@ -166,7 +167,7 @@ protected:
* @return The metadata of the deleted archive file including the metadata of * @return The metadata of the deleted archive file including the metadata of
* the associated and also deleted tape copies. * the associated and also deleted tape copies.
*/ */
void deleteArchiveFile(const std::string &instanceName, const uint64_t archiveFileId, void DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(const std::string &instanceName, const uint64_t archiveFileId,
log::LogContext &lc) override; log::LogContext &lc) override;
/** /**
......
...@@ -770,7 +770,7 @@ std::map<uint64_t, OracleCatalogue::FileSizeAndChecksum> OracleCatalogue::select ...@@ -770,7 +770,7 @@ std::map<uint64_t, OracleCatalogue::FileSizeAndChecksum> OracleCatalogue::select
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// deleteArchiveFile // deleteArchiveFile
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void OracleCatalogue::deleteArchiveFile(const std::string &diskInstanceName, const uint64_t archiveFileId, void OracleCatalogue::DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(const std::string &diskInstanceName, const uint64_t archiveFileId,
log::LogContext &lc) { log::LogContext &lc) {
try { try {
const char *selectSql = const char *selectSql =
......
...@@ -149,6 +149,7 @@ public: ...@@ -149,6 +149,7 @@ public:
void filesWrittenToTape(const std::set<TapeItemWrittenPointer> &events) override; void filesWrittenToTape(const std::set<TapeItemWrittenPointer> &events) override;
/** /**
* !!!!!!!!!!!!!!!!!!! THIS METHOD SHOULD NOT BE USED !!!!!!!!!!!!!!!!!!!!!!!
* Deletes the specified archive file and its associated tape copies from the * Deletes the specified archive file and its associated tape copies from the
* catalogue. * catalogue.
* *
...@@ -166,7 +167,7 @@ public: ...@@ -166,7 +167,7 @@ public:
* @return The metadata of the deleted archive file including the metadata of * @return The metadata of the deleted archive file including the metadata of
* the associated and also deleted tape copies. * the associated and also deleted tape copies.
*/ */
void deleteArchiveFile(const std::string &instanceName, const uint64_t archiveFileId, void DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(const std::string &instanceName, const uint64_t archiveFileId,
log::LogContext &lc) override; log::LogContext &lc) override;
private: private:
......
...@@ -700,7 +700,7 @@ void PostgresCatalogue::insertTapeFileBatchIntoTempTable(rdbms::Conn &conn, ...@@ -700,7 +700,7 @@ void PostgresCatalogue::insertTapeFileBatchIntoTempTable(rdbms::Conn &conn,
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// deleteArchiveFile // deleteArchiveFile
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void PostgresCatalogue::deleteArchiveFile(const std::string &diskInstanceName, const uint64_t archiveFileId, void PostgresCatalogue::DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(const std::string &diskInstanceName, const uint64_t archiveFileId,
log::LogContext &lc) { log::LogContext &lc) {
try { try {
const char *selectSql = const char *selectSql =
......
...@@ -56,6 +56,7 @@ public: ...@@ -56,6 +56,7 @@ public:
~PostgresCatalogue() override; ~PostgresCatalogue() override;
/** /**
* !!!!!!!!!!!!!!!!!!! THIS METHOD SHOULD NOT BE USED !!!!!!!!!!!!!!!!!!!!!!!
* Deletes the specified archive file and its associated tape copies from the * Deletes the specified archive file and its associated tape copies from the
* catalogue. * catalogue.
* *
...@@ -73,7 +74,7 @@ public: ...@@ -73,7 +74,7 @@ public:
* @return The metadata of the deleted archive file including the metadata of * @return The metadata of the deleted archive file including the metadata of
* the associated and also deleted tape copies. * the associated and also deleted tape copies.
*/ */
void deleteArchiveFile(const std::string &instanceName, const uint64_t archiveFileId, void DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(const std::string &instanceName, const uint64_t archiveFileId,
log::LogContext &lc) override; log::LogContext &lc) override;
/** /**
......
...@@ -57,7 +57,7 @@ SqliteCatalogue::~SqliteCatalogue() { ...@@ -57,7 +57,7 @@ SqliteCatalogue::~SqliteCatalogue() {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// deleteArchiveFile // deleteArchiveFile
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void SqliteCatalogue::deleteArchiveFile(const std::string &diskInstanceName, const uint64_t archiveFileId, void SqliteCatalogue::DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(const std::string &diskInstanceName, const uint64_t archiveFileId,
log::LogContext &lc) { log::LogContext &lc) {
try { try {
utils::Timer t; utils::Timer t;
......
...@@ -57,6 +57,7 @@ public: ...@@ -57,6 +57,7 @@ public:
~SqliteCatalogue() override; ~SqliteCatalogue() override;
/** /**
* !!!!!!!!!!!!!!!!!!! THIS METHOD SHOULD NOT BE USED !!!!!!!!!!!!!!!!!!!!!!!
* SqliteCatalogue implements its own version of deleteArchiveFile() because * SqliteCatalogue implements its own version of deleteArchiveFile() because
* SQLite does not supprt 'SELECT FOR UPDATE'. * SQLite does not supprt 'SELECT FOR UPDATE'.
* *
...@@ -77,7 +78,7 @@ public: ...@@ -77,7 +78,7 @@ public:
* @return The metadata of the deleted archive file including the metadata of * @return The metadata of the deleted archive file including the metadata of
* the associated and also deleted tape copies. * the associated and also deleted tape copies.
*/ */
void deleteArchiveFile(const std::string &diskInstanceName, const uint64_t archiveFileId, log::LogContext &lc) void DO_NOT_USE_deleteArchiveFile_DO_NOT_USE(const std::string &diskInstanceName, const uint64_t archiveFileId, log::LogContext &lc)
override; override;
protected: protected:
......
...@@ -260,7 +260,6 @@ void Scheduler::deleteArchive(const std::string &instanceName, const common::dat ...@@ -260,7 +260,6 @@ void Scheduler::deleteArchive(const std::string &instanceName, const common::dat
m_db.cancelArchive(request,lc); m_db.cancelArchive(request,lc);
} }
tl.insertAndReset("schedulerDbTime",t); tl.insertAndReset("schedulerDbTime",t);
//m_catalogue.deleteArchiveFile(instanceName, request.archiveFileID, lc);
m_catalogue.moveArchiveFileToRecycleBin(request,lc); m_catalogue.moveArchiveFileToRecycleBin(request,lc);
tl.insertAndReset("catalogueTime",t); tl.insertAndReset("catalogueTime",t);
log::ScopedParamContainer spc(lc); log::ScopedParamContainer spc(lc);
......
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