Skip to content
GitLab
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
9a05d0a7
Commit
9a05d0a7
authored
Apr 16, 2014
by
Eric Cano
Browse files
Removed job injector from disk write task to move it to the reader task.
parent
2f444f07
Changes
4
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/DiskWriteTask.hpp
View file @
9a05d0a7
...
...
@@ -33,6 +33,7 @@
#include
<memory>
namespace
{
// TODO: merge with same function in File.hpp and move to tape/utils
uint32_t
blockID
(
const
castor
::
tape
::
tapegateway
::
FileToRecallStruct
&
ftr
)
{
return
(
ftr
.
blockId0
()
<<
24
)
|
(
ftr
.
blockId1
()
<<
16
)
|
(
ftr
.
blockId2
()
<<
8
)
|
ftr
.
blockId3
();
...
...
castor/tape/tapeserver/daemon/DiskWriteThreadPool.cpp
View file @
9a05d0a7
...
...
@@ -9,7 +9,7 @@ namespace daemon {
DiskWriteThreadPool
::
DiskWriteThreadPool
(
int
nbThread
,
int
maxFilesReq
,
int
maxBlocksReq
,
ReportPackerInterface
<
detail
::
Recall
>&
report
,
castor
::
log
::
LogContext
lc
)
:
m_jobInjector
(
NULL
),
m_maxFilesReq
(
maxFilesReq
),
m_maxBytesReq
(
maxBlocksReq
),
m_maxFilesReq
(
maxFilesReq
),
m_maxBytesReq
(
maxBlocksReq
),
m_reporter
(
report
),
m_lc
(
lc
)
{
for
(
int
i
=
0
;
i
<
nbThread
;
i
++
)
{
...
...
@@ -50,9 +50,6 @@ namespace daemon {
m_tasks
.
push
(
NULL
);
}
}
void
DiskWriteThreadPool
::
setJobInjector
(
TaskInjector
*
ji
){
m_jobInjector
=
ji
;
}
bool
DiskWriteThreadPool
::
belowMidFilesAfterPop
(
int
filesPopped
)
const
{
return
m_tasks
.
size
()
-
filesPopped
<
m_maxFilesReq
/
2
;
...
...
@@ -66,6 +63,7 @@ namespace daemon {
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
);
...
...
@@ -82,7 +80,6 @@ namespace daemon {
tape
::
utils
::
suppresUnusedVariable
(
sp
);
m_lc
.
log
(
LOG_INFO
,
"In DiskWriteTaskInterface::popAndRequestMoreJobs(), requesting last call"
);
m_jobInjector
->
requestInjection
(
m_maxFilesReq
,
m_maxBytesReq
,
true
);
//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
))
{
...
...
@@ -94,7 +91,6 @@ namespace daemon {
};
tape
::
utils
::
suppresUnusedVariable
(
sp
);
m_lc
.
log
(
LOG_INFO
,
"In DiskWriteTaskInterface::popAndRequestMoreJobs(), requesting: files"
);
m_jobInjector
->
requestInjection
(
m_maxFilesReq
,
m_maxBytesReq
,
false
);
}
}
return
ret
;
...
...
castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp
View file @
9a05d0a7
...
...
@@ -52,7 +52,6 @@ public:
void
waitThreads
();
virtual
void
push
(
DiskWriteTaskInterface
*
t
);
void
finish
();
void
setJobInjector
(
TaskInjector
*
ji
);
private:
bool
belowMidFilesAfterPop
(
int
filesPopped
)
const
;
...
...
@@ -87,7 +86,6 @@ private:
std
::
vector
<
DiskWriteWorkerThread
*>
m_threads
;
castor
::
tape
::
threading
::
Mutex
m_counterProtection
;
TaskInjector
*
m_jobInjector
;
uint32_t
m_maxFilesReq
;
uint64_t
m_maxBytesReq
;
...
...
castor/tape/tapeserver/daemon/DiskWriteThreadPoolTest.cpp
View file @
9a05d0a7
...
...
@@ -29,7 +29,6 @@ namespace unitTests{
TEST
(
castor_tape_tapeserver_daemon
,
DiskWriteThreadPoolTest
){
using
::
testing
::
_
;
MockTaskInjector
tskInjectorl
;
MockClient
client
;
castor
::
log
::
StringLogger
log
(
"castor_tape_tapeserver_daemon_DiskWriteThreadPoolTest"
);
castor
::
log
::
LogContext
lc
(
log
);
...
...
@@ -42,7 +41,6 @@ namespace unitTests{
RecallMemoryManager
mm
(
10
,
100
);
DiskWriteThreadPool
dwtp
(
2
,
5
,
500
,
report
,
lc
);
dwtp
.
setJobInjector
(
&
tskInjectorl
);
dwtp
.
startThreads
();
castor
::
tape
::
tapegateway
::
FileToRecallStruct
file
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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