diff --git a/catalogue/Catalogue.hpp b/catalogue/Catalogue.hpp index 81499d87cba3080322a7a666d8e463bdf6264ee3..0777eb091f330fe18e1f974ba72cd0afc7c94b17 100644 --- a/catalogue/Catalogue.hpp +++ b/catalogue/Catalogue.hpp @@ -121,7 +121,14 @@ public: */ virtual void tapeMountedForArchive(const std::string &vid, const std::string &drive) = 0; // internal function (noCLI) - virtual void modifyTapeLastReadLog(const std::string &vid, const std::string &drive) = 0; // internal function (noCLI) + /** + * Notifies the CTA catalogue that the specified tape has been mounted in + * order to retrieve files. + * + * @param vid The volume identifier of the tape. + * @param drive The name of the drive where the tape was mounted. + */ + virtual void tapeMountedForRetrieve(const std::string &vid, const std::string &drive) = 0; // internal function (noCLI) /** * This method notifies the CTA catalogue that there is no more free space on diff --git a/catalogue/CatalogueTest.cpp b/catalogue/CatalogueTest.cpp index 2d8efa0bfe0588521ecb2b28c680fe1400443fd9..ee4d2a6fb0955f37e0bfbd0dd8f832f86b47957d 100644 --- a/catalogue/CatalogueTest.cpp +++ b/catalogue/CatalogueTest.cpp @@ -2704,7 +2704,7 @@ TEST_P(cta_catalogue_CatalogueTest, tapeMountedForArchive_nonExistentTape) { ASSERT_THROW(m_catalogue->tapeMountedForArchive(vid, drive), exception::UserError); } -TEST_P(cta_catalogue_CatalogueTest, modifyTapeLastReadLog) { +TEST_P(cta_catalogue_CatalogueTest, tapeMountedForRetrieve) { using namespace cta; ASSERT_TRUE(m_catalogue->getTapes().empty()); @@ -2753,7 +2753,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeLastReadLog) { } const std::string modifiedDrive = "modified_drive"; - m_catalogue->modifyTapeLastReadLog(vid, modifiedDrive); + m_catalogue->tapeMountedForRetrieve(vid, modifiedDrive); { const std::list<common::dataStructures::Tape> tapes = m_catalogue->getTapes(); @@ -2781,7 +2781,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeLastReadLog) { } } -TEST_P(cta_catalogue_CatalogueTest, modifyTapeLastReadLog_nonExistentTape) { +TEST_P(cta_catalogue_CatalogueTest, tapeMountedForRetrieve_nonExistentTape) { using namespace cta; ASSERT_TRUE(m_catalogue->getTapes().empty()); @@ -2789,7 +2789,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeLastReadLog_nonExistentTape) { const std::string vid = "vid"; const std::string drive = "drive"; - ASSERT_THROW(m_catalogue->modifyTapeLastReadLog(vid, drive), exception::UserError); + ASSERT_THROW(m_catalogue->tapeMountedForRetrieve(vid, drive), exception::UserError); } TEST_P(cta_catalogue_CatalogueTest, setTapeFull) { diff --git a/catalogue/RdbmsCatalogue.cpp b/catalogue/RdbmsCatalogue.cpp index c8b9072a0b4b448dbfe187b456e4ec90f323464b..0cde6508ce9b67568777e9e19b8e7bfb0334bc52 100644 --- a/catalogue/RdbmsCatalogue.cpp +++ b/catalogue/RdbmsCatalogue.cpp @@ -1935,9 +1935,9 @@ void RdbmsCatalogue::tapeMountedForArchive(const std::string &vid, const std::st } //------------------------------------------------------------------------------ -// modifyTapeLastReadLog +// tapeMountedForRetrieve //------------------------------------------------------------------------------ -void RdbmsCatalogue::modifyTapeLastReadLog(const std::string &vid, const std::string &drive) { +void RdbmsCatalogue::tapeMountedForRetrieve(const std::string &vid, const std::string &drive) { try { const time_t now = time(nullptr); const char *const sql = diff --git a/catalogue/RdbmsCatalogue.hpp b/catalogue/RdbmsCatalogue.hpp index def82d1707805855500b7d8a2e24f07640a1f582..7fb0f601610325e0350bb8a110d5984c4358ecdd 100644 --- a/catalogue/RdbmsCatalogue.hpp +++ b/catalogue/RdbmsCatalogue.hpp @@ -106,8 +106,23 @@ public: */ virtual void noSpaceLeftOnTape(const std::string &vid) override; + /** + * Notifies the CTA catalogue that the specified tape has been mounted in + * order to archive files. + * + * @param vid The volume identifier of the tape. + * @param drive The name of the drive where the tape was mounted. + */ virtual void tapeMountedForArchive(const std::string &vid, const std::string &drive) override; // internal function (noCLI) - virtual void modifyTapeLastReadLog(const std::string &vid, const std::string &drive) override; // internal function (noCLI) + + /** + * Notifies the CTA catalogue that the specified tape has been mounted in + * order to retrieve files. + * + * @param vid The volume identifier of the tape. + * @param drive The name of the drive where the tape was mounted. + */ + virtual void tapeMountedForRetrieve(const std::string &vid, const std::string &drive) override; // internal function (noCLI) //////////////////////////////////////////////////////////////// // METHODS TO BE CALLED BY THE CTA TAPE SERVER DAEMON END HERE