Commit df9b2028 authored by David COME's avatar David COME
Browse files

Refactor the code dedicated to the computation to the first fseq to...

Refactor the code dedicated to the computation to the first fseq to writte/last fseq written on tape
parent a70149bb
......@@ -295,6 +295,8 @@ int castor::tape::tapeserver::daemon::DataTransferSession::executeWrite(log::Log
drtp.setTaskInjector(&mti);
if (mti.synchronousInjection()) {
const uint64_t firstFseqFromClient = mti.firstFseqToWrite();
//the last fseq written on the tape is the first file's fseq minus one
twst.setlastFseq(firstFseqFromClient-1);
//we retrieved the detail from the client in execute, so at this point
......
......@@ -95,6 +95,8 @@ namespace daemon {
m_diskReader.push(drt.release());
m_lc.log(LOG_INFO, "Logged file to migrate");
}
LogContext::ScopedParam(m_lc, Param("numbnerOfFiles", jobs.size()));
m_lc.log(LOG_INFO, "Finished creating tasks for migrating");
}
//------------------------------------------------------------------------------
......@@ -149,7 +151,7 @@ namespace daemon {
return false;
} else {
std::vector<tapegateway::FileToMigrateStruct*>& jobs=filesToMigrateList->filesToMigrate();
m_lastFseq = jobs.front()->fseq() -1;
m_firstFseqToWrite = jobs.front()->fseq();
injectBulkMigrations(jobs);
return true;
}
......@@ -246,7 +248,9 @@ namespace daemon {
}
}
uint64_t MigrationTaskInjector::firstFseqToWrite() const {
return m_firstFseqToWrite;
}
} //end namespace daemon
} //end namespace tapeserver
} //end namespace tape
......
......@@ -99,9 +99,11 @@ public:
*/
void finish();
uint64_t lastFSeq() const {
return m_lastFseq;
}
/**
* Return the first file to be written's fseq
* @return
*/
uint64_t firstFseqToWrite() const;
private:
/**
* Create all the tape-read and write-disk tasks for set of files to retrieve
......@@ -206,7 +208,7 @@ private:
* after we make sure synchronousInjection returned true. To do so, we
* need to store it
*/
uint64_t m_lastFseq;
uint64_t m_firstFseqToWrite;
};
} //end namespace daemon
......
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