Commit b0b1e70d authored by Eric Cano's avatar Eric Cano
Browse files

Fixed confusion between archive and retieve in logging "path" and creation of...

Fixed confusion between archive and retieve in logging "path" and creation of file object by file factory.
parent 5f6da2da
......@@ -66,9 +66,9 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
checkMigrationFailing();
currentErrorToCount = "Error_diskOpenForRead";
std::unique_ptr<tape::diskFile::ReadFile> sourceFile(
fileFactory.createReadFile(m_archiveJob->archiveFile.path));
fileFactory.createReadFile(m_archiveJob->remotePathAndStatus.path.getRaw()));
log::ScopedParamContainer URLcontext(lc);
URLcontext.add("path", m_archiveJob->archiveFile.path)
URLcontext.add("path", m_archiveJob->remotePathAndStatus.path.getRaw())
.add("actualURL", sourceFile->URL());
currentErrorToCount = "Error_diskFileToReadSizeMismatch";
if(migratingFileSize != sourceFile->size()){
......@@ -209,7 +209,7 @@ void DiskReadTask::logWithStat(int level,const std::string& msg,log::LogContext&
.add("openRWCloseToTransferTimeRatio",
m_stats.transferTime?(m_stats.openingTime+m_stats.readWriteTime+m_stats.closingTime)/m_stats.transferTime:0.0)
.add("FILEID",m_archiveJob->archiveFile.fileId)
.add("path",m_archiveJob->archiveFile.path);
.add("path",m_archiveJob->remotePathAndStatus.path.getRaw());
lc.log(level,msg);
}
......
......@@ -53,7 +53,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
castor::utils::Timer transferTime(localTime);
log::ScopedParamContainer URLcontext(lc);
URLcontext.add("NSFILEID",m_retrieveJob->archiveFile.fileId)
.add("path", m_retrieveJob->archiveFile.path)
.add("path", m_retrieveJob->remotePath)
.add("fSeq",m_retrieveJob->nameServerTapeFile.tapeFileLocation.fSeq);
// This out-of-try-catch variables allows us to record the stage of the
// process we're in, and to count the error if it occurs.
......@@ -257,7 +257,7 @@ void DiskWriteTask::logWithStat(int level,const std::string& msg,log::LogContext
.add("openRWCloseToTransferTimeRatio",
m_stats.transferTime?(m_stats.openingTime+m_stats.readWriteTime+m_stats.closingTime)/m_stats.transferTime:0.0)
.add("FILEID",m_retrieveJob->archiveFile.fileId)
.add("path",m_retrieveJob->archiveFile.path);
.add("path",m_retrieveJob->remotePath);
lc.log(level,msg);
}
}}}}
......
......@@ -110,8 +110,11 @@ namespace unitTests{
for(int i=0;i<5;++i){
std::unique_ptr<TestingRetrieveJob> fileToRecall(new TestingRetrieveJob());
fileToRecall->archiveFile.path = "/dev/null";
std::stringstream path;
path << "/my/beautyful/archive/file" << i;
fileToRecall->archiveFile.path = path.str();
fileToRecall->archiveFile.fileId = i+1;
fileToRecall->remotePath = "/dev/null";
fileToRecall->nameServerTapeFile.tapeFileLocation.blockId = 1;
DiskWriteTask* t=new DiskWriteTask(fileToRecall.release(),mm);
MemBlock* mb=mm.getFreeBlock();
......
......@@ -59,7 +59,7 @@ namespace daemon {
LogContext::ScopedParam(m_lc, Param("NSHOSTNAME", (*it)->archiveFile.nsHostName)),
LogContext::ScopedParam(m_lc, Param("NSFILEID", (*it)->archiveFile.fileId)),
LogContext::ScopedParam(m_lc, Param("fSeq", (*it)->nameServerTapeFile.tapeFileLocation.fSeq)),
LogContext::ScopedParam(m_lc, Param("path", (*it)->archiveFile.path))
LogContext::ScopedParam(m_lc, Param("path", (*it)->remotePathAndStatus.path.getRaw()))
};
tape::utils::suppresUnusedVariable(sp);
......
......@@ -95,7 +95,7 @@ void RecallTaskInjector::injectBulkRecalls(const std::vector<cta::RetrieveJob *>
LogContext::ScopedParam(m_lc, Param("NSFILEID", (*it)->archiveFile.fileId)),
LogContext::ScopedParam(m_lc, Param("fSeq", (*it)->nameServerTapeFile.tapeFileLocation.fSeq)),
LogContext::ScopedParam(m_lc, Param("blockID", (*it)->nameServerTapeFile.tapeFileLocation.blockId)),
LogContext::ScopedParam(m_lc, Param("path", (*it)->archiveFile.path))
LogContext::ScopedParam(m_lc, Param("path", (*it)->remotePath))
};
tape::utils::suppresUnusedVariable(sp);
......
......@@ -73,7 +73,7 @@ public:
.add("NSFILEID", m_retrieveJob->archiveFile.fileId)
.add("BlockId", m_retrieveJob->nameServerTapeFile.tapeFileLocation.blockId)
.add("fSeq", m_retrieveJob->nameServerTapeFile.tapeFileLocation.fSeq)
.add("path", m_retrieveJob->archiveFile.path);
.add("path", m_retrieveJob->remotePath);
// We will clock the stats for the file itself, and eventually add those
// stats to the session's.
......
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