Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
d02b2c0e
Commit
d02b2c0e
authored
Apr 28, 2014
by
David COME
Browse files
Cleanup the leftovers of the feedback loop in DiskWriteThreadPool
parent
2547718e
Changes
2
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/DiskWriteThreadPool.cpp
View file @
d02b2c0e
...
...
@@ -63,42 +63,7 @@ namespace daemon {
bool
DiskWriteThreadPool
::
crossingDownFileThreshod
(
int
filesPopped
)
const
{
return
(
m_tasks
.
size
()
>=
m_maxFilesReq
/
2
)
&&
(
m_tasks
.
size
()
-
filesPopped
<
m_maxFilesReq
/
2
);
}
DiskWriteTaskInterface
*
DiskWriteThreadPool
::
popAndRequestMoreJobs
()
{
using
castor
::
log
::
LogContext
;
using
castor
::
log
::
Param
;
DiskWriteTaskInterface
*
ret
=
m_tasks
.
pop
();
// TODO: completely remove task injection in writers, move it to readers
if
(
ret
)
{
castor
::
tape
::
threading
::
MutexLocker
ml
(
&
m_counterProtection
);
// We are about to go to empty: request a last call job injection
if
(
m_tasks
.
size
()
==
1
)
{
LogContext
::
ScopedParam
sp
[]
=
{
LogContext
::
ScopedParam
(
m_lc
,
Param
(
"files"
,
m_tasks
.
size
())),
LogContext
::
ScopedParam
(
m_lc
,
Param
(
"ret->files"
,
1
)),
LogContext
::
ScopedParam
(
m_lc
,
Param
(
"maxFiles"
,
m_maxFilesReq
)),
LogContext
::
ScopedParam
(
m_lc
,
Param
(
"maxBlocks"
,
m_maxBytesReq
))
};
tape
::
utils
::
suppresUnusedVariable
(
sp
);
m_lc
.
log
(
LOG_INFO
,
"In DiskWriteTaskInterface::popAndRequestMoreJobs(), requesting last call"
);
//if we are below mid on both block and files and we are crossing a threshold
//on either files of blocks, then request more jobs
}
else
if
(
belowMidFilesAfterPop
(
1
)
&&
crossingDownFileThreshod
(
1
))
{
LogContext
::
ScopedParam
sp
[]
=
{
LogContext
::
ScopedParam
(
m_lc
,
Param
(
"files"
,
m_tasks
.
size
())),
LogContext
::
ScopedParam
(
m_lc
,
Param
(
"ret->files"
,
1
)),
LogContext
::
ScopedParam
(
m_lc
,
Param
(
"maxFiles"
,
m_maxFilesReq
)),
LogContext
::
ScopedParam
(
m_lc
,
Param
(
"maxBlocks"
,
m_maxBytesReq
))
};
tape
::
utils
::
suppresUnusedVariable
(
sp
);
m_lc
.
log
(
LOG_INFO
,
"In DiskWriteTaskInterface::popAndRequestMoreJobs(), requesting: files"
);
}
}
return
ret
;
}
void
DiskWriteThreadPool
::
DiskWriteWorkerThread
::
run
()
{
m_lc
.
pushOrReplace
(
log
::
Param
(
"thread"
,
"diskWrite"
));
m_lc
.
log
(
LOG_INFO
,
"Starting DiskWriteWorkerThread"
);
...
...
castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp
View file @
d02b2c0e
...
...
@@ -57,12 +57,6 @@ private:
bool
belowMidFilesAfterPop
(
int
filesPopped
)
const
;
bool
crossingDownFileThreshod
(
int
filesPopped
)
const
;
/**
* Pop a task from m_tasks.
* TODO The loopBack part (AndRequestMoreJob) should move to TapeReadSingleSthread
* @return
*/
DiskWriteTaskInterface
*
popAndRequestMoreJobs
()
;
tape
::
threading
::
AtomicCounter
<
int
>
m_nbActiveThread
;
tape
::
threading
::
AtomicCounter
<
int
>
m_failedWriteCount
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment