diff --git a/scheduler/ArchiveMount.cpp b/scheduler/ArchiveMount.cpp index e6d4742f8e9913343e4d542ed2bf9d5000151751..cb9acdd8ad3ac2b3d020b44772a891db7fdd5589 100644 --- a/scheduler/ArchiveMount.cpp +++ b/scheduler/ArchiveMount.cpp @@ -124,7 +124,7 @@ std::list<std::unique_ptr<cta::ArchiveJob> > cta::ArchiveMount::getNextJobBatch( //------------------------------------------------------------------------------ // reportJobsBatchWritten //------------------------------------------------------------------------------ -void cta::ArchiveMount::reportJobsBatchWritten(std::queue<std::unique_ptr<cta::ArchiveJob> > & successfulArchiveJobs, +void cta::ArchiveMount::reportJobsBatchTransferred(std::queue<std::unique_ptr<cta::ArchiveJob> > & successfulArchiveJobs, std::queue<cta::catalogue::TapeItemWritten> & skippedFiles, cta::log::LogContext& logContext) { std::set<cta::catalogue::TapeItemWrittenPointer> tapeItemsWritten; std::list<std::unique_ptr<cta::ArchiveJob> > validatedSuccessfulArchiveJobs; @@ -174,7 +174,7 @@ void cta::ArchiveMount::reportJobsBatchWritten(std::queue<std::unique_ptr<cta::A // We can now pass this list for the dbMount to process. We are done at that point. // Reporting to client will be queued if needed and done in another process. - m_dbMount->setJobBatchSuccessful(validatedSuccessfulDBArchiveJobs, logContext); + m_dbMount->setJobBatchTransferred(validatedSuccessfulDBArchiveJobs, logContext); schedulerDbTime=t.secs(utils::Timer::resetCounter); cta::log::ScopedParamContainer params(logContext); params.add("files", files) diff --git a/scheduler/ArchiveMount.hpp b/scheduler/ArchiveMount.hpp index a74d1a62e6cdc9f673bba9427c5beec24fbb46a0..2d4f7049dabc4b9d0be8a4a6010ff9c1fef1d63a 100644 --- a/scheduler/ArchiveMount.hpp +++ b/scheduler/ArchiveMount.hpp @@ -131,7 +131,7 @@ namespace cta { * @param successfulArchiveJobs the jobs to report * @param logContext */ - virtual void reportJobsBatchWritten (std::queue<std::unique_ptr<cta::ArchiveJob> > & successfulArchiveJobs, + virtual void reportJobsBatchTransferred (std::queue<std::unique_ptr<cta::ArchiveJob> > & successfulArchiveJobs, std::queue<cta::catalogue::TapeItemWritten> & skippedFiles, cta::log::LogContext &logContext); /** diff --git a/scheduler/OStoreDB/OStoreDB.cpp b/scheduler/OStoreDB/OStoreDB.cpp index 16ed3d32abc9d51f8ab9f6727128e430470e98ef..aa35fc6f3636b66545e59218697253c36f38b4d2 100644 --- a/scheduler/OStoreDB/OStoreDB.cpp +++ b/scheduler/OStoreDB/OStoreDB.cpp @@ -2335,9 +2335,9 @@ void OStoreDB::ArchiveMount::setTapeSessionStats(const castor::tape::tapeserver: } //------------------------------------------------------------------------------ -// OStoreDB::ArchiveMount::asyncSetJobBatchSuccessful() +// OStoreDB::ArchiveMount::setJobBatchTransferred() //------------------------------------------------------------------------------ -void OStoreDB::ArchiveMount::setJobBatchSuccessful(std::list<std::unique_ptr<cta::SchedulerDatabase::ArchiveJob>>& jobsBatch, +void OStoreDB::ArchiveMount::setJobBatchTransferred(std::list<std::unique_ptr<cta::SchedulerDatabase::ArchiveJob>>& jobsBatch, log::LogContext & lc) { std::set<cta::OStoreDB::ArchiveJob*> jobsToQueueForReporting; std::list<std::string> ajToUnown; @@ -2373,7 +2373,7 @@ void OStoreDB::ArchiveMount::setJobBatchSuccessful(std::list<std::unique_ptr<cta params.add("VID", j->tapeFile.vid) .add("fileId", j->archiveFile.archiveFileID) .add("requestObject", j->m_archiveRequest.getAddressIfSet()); - lc.log(log::INFO, "In OStoreDB::ArchiveMount::setJobBatchSuccessful(): will queue request for reporting."); + lc.log(log::INFO, "In OStoreDB::ArchiveMount::setJobBatchTransferred(): will queue request for reporting."); } for (auto &list: insertedElementsLists) { try { @@ -2384,12 +2384,12 @@ void OStoreDB::ArchiveMount::setJobBatchSuccessful(std::list<std::unique_ptr<cta params.add("VID", list.first) .add("jobs", list.second.size()) .add("enqueueTime", t.secs()); - lc.log(log::INFO, "In OStoreDB::ArchiveMount::setJobBatchSuccessful(): queued a batch of requests for reporting."); + lc.log(log::INFO, "In OStoreDB::ArchiveMount::setJobBatchTransferred(): queued a batch of requests for reporting."); } catch (cta::exception::Exception & ex) { log::ScopedParamContainer params(lc); params.add("VID", list.first) .add("exceptionMSG", ex.getMessageValue()); - lc.log(log::ERR, "In OStoreDB::ArchiveMount::setJobBatchSuccessful(): failed to queue a batch of requests for reporting."); + lc.log(log::ERR, "In OStoreDB::ArchiveMount::setJobBatchTransferred(): failed to queue a batch of requests for reporting."); } } timingList.insertAndReset("queueingToReportTime", t); @@ -2403,7 +2403,7 @@ void OStoreDB::ArchiveMount::setJobBatchSuccessful(std::list<std::unique_ptr<cta params.add("QueuedRequests", jobsToQueueForReporting.size()) .add("PartiallyCompleteRequests", ajToUnown.size()); timingList.addToLog(params); - lc.log(log::INFO, "In OStoreDB::ArchiveMount::setJobBatchSuccessful(): set ArchiveRequests successful and queued for reporting."); + lc.log(log::INFO, "In OStoreDB::ArchiveMount::setJobBatchTransferred(): set ArchiveRequests successful and queued for reporting."); } } diff --git a/scheduler/OStoreDB/OStoreDB.hpp b/scheduler/OStoreDB/OStoreDB.hpp index 862d45943e2f88e026fc31b51e06d468e7b76112..bc37a953e297e3e29ef46f7d576dd26582258908 100644 --- a/scheduler/OStoreDB/OStoreDB.hpp +++ b/scheduler/OStoreDB/OStoreDB.hpp @@ -153,7 +153,7 @@ public: void setDriveStatus(cta::common::dataStructures::DriveStatus status, time_t completionTime) override; void setTapeSessionStats(const castor::tape::tapeserver::daemon::TapeSessionStats &stats) override; public: - void setJobBatchSuccessful( + void setJobBatchTransferred( std::list<std::unique_ptr<cta::SchedulerDatabase::ArchiveJob>>& jobsBatch, log::LogContext & lc) override; }; friend class ArchiveMount; diff --git a/scheduler/SchedulerDatabase.hpp b/scheduler/SchedulerDatabase.hpp index cb9b14efa19e8929255b3e2805f95bf0fa92db99..5238ff9093e2d02583855a2fca0ee3cd6a03cee5 100644 --- a/scheduler/SchedulerDatabase.hpp +++ b/scheduler/SchedulerDatabase.hpp @@ -153,7 +153,7 @@ public: virtual void complete(time_t completionTime) = 0; virtual void setDriveStatus(common::dataStructures::DriveStatus status, time_t completionTime) = 0; virtual void setTapeSessionStats(const castor::tape::tapeserver::daemon::TapeSessionStats &stats) = 0; - virtual void setJobBatchSuccessful( + virtual void setJobBatchTransferred( std::list<std::unique_ptr<cta::SchedulerDatabase::ArchiveJob>> & jobsBatch, log::LogContext & lc) = 0; virtual ~ArchiveMount() {} uint32_t nbFilesCurrentlyOnTape; diff --git a/scheduler/SchedulerTest.cpp b/scheduler/SchedulerTest.cpp index ab869a06872b762a0ef54a22552cee1fcfd99019..3951d28c9ad7890afb36de195608333a11941686 100644 --- a/scheduler/SchedulerTest.cpp +++ b/scheduler/SchedulerTest.cpp @@ -467,7 +467,7 @@ TEST_P(SchedulerTest, archive_and_retrieve_new_file) { std::queue<std::unique_ptr <cta::ArchiveJob >> sDBarchiveJobBatch; std::queue<cta::catalogue::TapeItemWritten> sTapeItems; sDBarchiveJobBatch.emplace(std::move(archiveJob)); - archiveMount->reportJobsBatchWritten(sDBarchiveJobBatch, sTapeItems, lc); + archiveMount->reportJobsBatchTransferred(sDBarchiveJobBatch, sTapeItems, lc); archiveJobBatch = archiveMount->getNextJobBatch(1,1,lc); ASSERT_EQ(0, archiveJobBatch.size()); archiveMount->complete(); diff --git a/scheduler/testingMocks/MockArchiveMount.hpp b/scheduler/testingMocks/MockArchiveMount.hpp index ee875a9b2bb60bff9388b18dd218c1b885a574be..48593ff7cd003e3bfa76dcabc18bf149c0407ced 100644 --- a/scheduler/testingMocks/MockArchiveMount.hpp +++ b/scheduler/testingMocks/MockArchiveMount.hpp @@ -49,7 +49,7 @@ namespace cta { } } - void reportJobsBatchWritten(std::queue<std::unique_ptr<cta::ArchiveJob> >& successfulArchiveJobs, + void reportJobsBatchTransferred(std::queue<std::unique_ptr<cta::ArchiveJob> >& successfulArchiveJobs, std::queue<cta::catalogue::TapeItemWritten> & skippedFiles, cta::log::LogContext& logContext) override { try { std::set<cta::catalogue::TapeItemWrittenPointer> tapeItemsWritten; diff --git a/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.cpp b/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.cpp index 1de0dfb8a3cb742886318985768c855be9d6342c..6f37b52595d4a0fabc5e1e1f286eb44db50c1137 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.cpp @@ -245,7 +245,7 @@ void MigrationReportPacker::ReportFlush::execute(MigrationReportPacker& reportPa reportPacker.m_lc.log(cta::log::INFO,"Received a flush report from tape, but had no file to report to client. Doing nothing."); return; } - reportPacker.m_archiveMount->reportJobsBatchWritten(reportPacker.m_successfulArchiveJobs, reportPacker.m_skippedFiles, + reportPacker.m_archiveMount->reportJobsBatchTransferred(reportPacker.m_successfulArchiveJobs, reportPacker.m_skippedFiles, reportPacker.m_lc); } else { // This is an abnormal situation: we should never flush after an error!