Commit 5c3d1d92 authored by Eric Cano's avatar Eric Cano
Browse files

Unified function names for transfers to tapes.

parent e1ca79f2
......@@ -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)
......
......@@ -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);
/**
......
......@@ -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.");
}
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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();
......
......@@ -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;
......
......@@ -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!
......
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