Commit 713f2ed6 authored by David COME's avatar David COME
Browse files

Added a few logs in DiskReadThreadPool ans fixed some log levels into...

Added a few logs in DiskReadThreadPool ans fixed some log levels into MemManager MigrationTaskInjector and
RecallMemoryManager
parent d02b2c0e
......@@ -37,6 +37,8 @@ namespace daemon {
for(int i=0; i<nbThread; i++) {
DiskReadWorkerThread * thr = new DiskReadWorkerThread(*this);
m_threads.push_back(thr);
m_lc.pushOrReplace(log::Param("threadID",i));
m_lc.log(LOG_INFO, "DiskReadWorkerThread created");
}
}
DiskReadThreadPool::~DiskReadThreadPool() {
......@@ -44,12 +46,14 @@ namespace daemon {
delete m_threads.back();
m_threads.pop_back();
}
m_lc.log(LOG_INFO, "All the DiskReadWorkerThreads have been destroyed");
}
void DiskReadThreadPool::startThreads() {
for (std::vector<DiskReadWorkerThread *>::iterator i=m_threads.begin();
i != m_threads.end(); i++) {
(*i)->startThreads();
}
m_lc.log(LOG_INFO, "All the DiskReadWorkerThreads are started");
}
void DiskReadThreadPool::waitThreads() {
for (std::vector<DiskReadWorkerThread *>::iterator i=m_threads.begin();
......@@ -59,6 +63,7 @@ namespace daemon {
}
void DiskReadThreadPool::push(DiskReadTaskInterface *t) {
m_tasks.push(t);
m_lc.log(LOG_INFO, "Push a task into the DiskReadThreadPool");
}
void DiskReadThreadPool::finish() {
/* Insert one endOfSession per thread */
......@@ -69,17 +74,21 @@ namespace daemon {
DiskReadTaskInterface* DiskReadThreadPool::popAndRequestMore(){
castor::tape::threading::BlockingQueue<DiskReadTaskInterface*>::valueRemainingPair
vrp = m_tasks.popGetSize();
log::LogContext::ScopedParam sp(m_lc, log::Param("m_maxFilesReq", m_maxFilesReq));
log::LogContext::ScopedParam sp0(m_lc, log::Param("m_maxBytesReq", m_maxBytesReq));
if(0==vrp.remaining){
m_injector->requestInjection(m_maxFilesReq, m_maxBytesReq,true);
m_lc.log(LOG_DEBUG, "Requested injection from MigrationTaskInjector (with last call)");
}else if(vrp.remaining + 1 == m_maxFilesReq/2){
m_injector->requestInjection(m_maxFilesReq, m_maxBytesReq,false);
m_lc.log(LOG_DEBUG, "Requested injection from MigrationTaskInjector (without last call)");
}
return vrp.value;
}
void DiskReadThreadPool::DiskReadWorkerThread::run() {
m_lc.pushOrReplace(log::Param("thread", "DiskRead"));
m_lc.log(LOG_DEBUG, "Starting DiskReadWorkerThread");
m_lc.pushOrReplace(log::Param("threadID",m_threadID));
m_lc.log(LOG_DEBUG, "DiskReadWorkerThread Running");
std::auto_ptr<DiskReadTaskInterface> task;
while(1) {
task.reset( m_parent.popAndRequestMore());
......@@ -94,9 +103,9 @@ namespace daemon {
// will hence be no more requests for more. (last thread turns off the light)
if (0 == --m_parent.m_nbActiveThread) {
m_parent.m_injector->finish();
m_lc.log(LOG_DEBUG, "Signaled to task injector the end of disk read threads");
m_lc.log(LOG_INFO, "Signaled to task injector the end of disk read threads");
}
m_lc.log(LOG_DEBUG, "Finishing of DiskReadWorkerThread");
m_lc.log(LOG_INFO, "Finishing of DiskReadWorkerThread");
}
}}}}
......
......@@ -59,7 +59,7 @@ public:
m_totalMemoryAllocated+=blockSize;
m_lc.pushOrReplace(log::Param("blockId",i));
m_lc.log(LOG_INFO,"MigrationMemoryManager Created a block");
m_lc.log(LOG_DEBUG,"MigrationMemoryManager Created a block");
}
m_lc.log(LOG_INFO,"MigrationMemoryManager: all blocks have been created");
}
......
......@@ -132,7 +132,7 @@ namespace daemon {
//------------------------------------------------------------------------------
void MigrationTaskInjector::WorkerThread::run(){
m_parent.m_lc.pushOrReplace(Param("thread", "MigrationTaskInjector"));
m_parent.m_lc.log(LOG_DEBUG, "Starting MigrationTaskInjector thread");
m_parent.m_lc.log(LOG_INFO, "Starting MigrationTaskInjector thread");
try{
while(1){
if(m_parent.m_errorFlag){
......@@ -171,7 +171,7 @@ namespace daemon {
}
} // end of while(1)
//-------------
m_parent.m_lc.log(LOG_DEBUG, "Finishing MigrationTaskInjector thread");
m_parent.m_lc.log(LOG_INFO, "Finishing MigrationTaskInjector thread");
/* We want to finish at the first lastCall we encounter.
* But even after sending finish() to m_diskWriter and to m_tapeReader,
* m_diskWriter might still want some more task (the threshold could be crossed),
......
......@@ -55,7 +55,7 @@ public:
m_freeBlocks.push(new MemBlock(i, blockSize));
m_lc.pushOrReplace(log::Param("blockId",i));
m_lc.log(LOG_INFO,"RecallMemoryManager created a block");
m_lc.log(LOG_DEBUG,"RecallMemoryManager created a block");
}
m_lc.log(LOG_INFO,"RecallMemoryManager: all blocks have been created");
}
......
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