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
cee91084
Commit
cee91084
authored
May 06, 2014
by
David COME
Browse files
Suppressed TapeWriteTaskInterface and TapeReadTaskInterface
parent
2ff57d7f
Changes
11
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/DiskReadThreadPool.cpp
View file @
cee91084
...
...
@@ -27,6 +27,8 @@
#include
<sstream>
#include
"castor/tape/tapeserver/daemon/MigrationTaskInjector.hpp"
#include
"log.h"
#include
"castor/tape/tapeserver/daemon/MigrationReportPacker.hpp"
namespace
castor
{
namespace
tape
{
namespace
tapeserver
{
...
...
castor/tape/tapeserver/daemon/MigrationTaskInjector.cpp
View file @
cee91084
...
...
@@ -54,7 +54,7 @@ namespace daemon {
//------------------------------------------------------------------------------
MigrationTaskInjector
::
MigrationTaskInjector
(
MigrationMemoryManager
&
mm
,
DiskReadThreadPool
&
diskReader
,
TapeSingleThreadInterface
<
TapeWriteTask
Interface
>
&
tapeWriter
,
client
::
ClientInterface
&
client
,
TapeSingleThreadInterface
<
TapeWriteTask
>
&
tapeWriter
,
client
::
ClientInterface
&
client
,
uint64_t
maxFiles
,
uint64_t
byteSizeThreshold
,
castor
::
log
::
LogContext
lc
)
:
m_thread
(
*
this
),
m_memManager
(
mm
),
m_tapeWriter
(
tapeWriter
),
m_diskReader
(
diskReader
),
m_client
(
client
),
m_lc
(
lc
),
...
...
castor/tape/tapeserver/daemon/MigrationTaskInjector.hpp
View file @
cee91084
...
...
@@ -63,7 +63,7 @@ public:
*/
MigrationTaskInjector
(
MigrationMemoryManager
&
mm
,
DiskReadThreadPool
&
diskReader
,
TapeSingleThreadInterface
<
TapeWriteTask
Interface
>
&
tapeWriter
,
client
::
ClientInterface
&
client
,
TapeSingleThreadInterface
<
TapeWriteTask
>
&
tapeWriter
,
client
::
ClientInterface
&
client
,
uint64_t
maxFiles
,
uint64_t
byteSizeThreshold
,
castor
::
log
::
LogContext
lc
);
/**
...
...
@@ -157,7 +157,7 @@ private:
///the one object that will hold the thread which will be executing
///tape-writing tasks
TapeSingleThreadInterface
<
TapeWriteTask
Interface
>&
m_tapeWriter
;
TapeSingleThreadInterface
<
TapeWriteTask
>&
m_tapeWriter
;
///the one object that will hold all the threads which will be executing
///disk-reading tasks
...
...
castor/tape/tapeserver/daemon/RecallTaskInjector.cpp
View file @
cee91084
...
...
@@ -35,7 +35,7 @@ namespace tapeserver{
namespace
daemon
{
RecallTaskInjector
::
RecallTaskInjector
(
RecallMemoryManager
&
mm
,
TapeSingleThreadInterface
<
TapeReadTask
Interface
>
&
tapeReader
,
TapeSingleThreadInterface
<
TapeReadTask
>
&
tapeReader
,
DiskWriteThreadPool
&
diskWriter
,
client
::
ClientInterface
&
client
,
uint64_t
maxFiles
,
uint64_t
byteSizeThreshold
,
castor
::
log
::
LogContext
lc
)
:
...
...
castor/tape/tapeserver/daemon/RecallTaskInjector.hpp
View file @
cee91084
...
...
@@ -42,7 +42,7 @@ namespace daemon {
class
RecallMemoryManager
;
class
DiskWriteThreadPool
;
class
TapeReadTask
Interface
;
class
TapeReadTask
;
/**
* This classis responsible for creating the tasks in case of a recall job
*/
...
...
@@ -62,7 +62,7 @@ public:
* @param lc copied because of the threading mechanism
*/
RecallTaskInjector
(
RecallMemoryManager
&
mm
,
TapeSingleThreadInterface
<
TapeReadTask
Interface
>
&
tapeReader
,
TapeSingleThreadInterface
<
TapeReadTask
>
&
tapeReader
,
DiskWriteThreadPool
&
diskWriter
,
client
::
ClientInterface
&
client
,
uint64_t
maxFiles
,
uint64_t
byteSizeThreshold
,
castor
::
log
::
LogContext
lc
);
...
...
@@ -153,7 +153,7 @@ private:
///the one object that will hold the thread which will be executing
///tape-reading tasks
TapeSingleThreadInterface
<
TapeReadTask
Interface
>
&
m_tapeReader
;
TapeSingleThreadInterface
<
TapeReadTask
>
&
m_tapeReader
;
///the one object that will hold all the threads which will be executing
///disk-writing tasks
...
...
castor/tape/tapeserver/daemon/RecallTaskInjectorTest.cpp
View file @
cee91084
...
...
@@ -20,14 +20,14 @@ public:
virtual
~
FakeDiskWriteThreadPool
()
{};
};
class
FakeSingleTapeReadThread
:
public
TapeSingleThreadInterface
<
TapeReadTask
Interface
>
class
FakeSingleTapeReadThread
:
public
TapeSingleThreadInterface
<
TapeReadTask
>
{
public:
using
TapeSingleThreadInterface
<
TapeReadTask
Interface
>::
m_tasks
;
using
TapeSingleThreadInterface
<
TapeReadTask
>::
m_tasks
;
FakeSingleTapeReadThread
(
castor
::
tape
::
drives
::
DriveInterface
&
drive
,
const
std
::
string
&
vid
,
castor
::
log
::
LogContext
&
lc
)
:
TapeSingleThreadInterface
<
TapeReadTask
Interface
>
(
drive
,
vid
,
lc
){}
TapeSingleThreadInterface
<
TapeReadTask
>
(
drive
,
vid
,
lc
){}
~
FakeSingleTapeReadThread
(){
const
unsigned
int
size
=
m_tasks
.
size
();
...
...
@@ -39,7 +39,7 @@ public:
{
m_tasks
.
push
(
NULL
);
}
virtual
void
push
(
TapeReadTask
Interface
*
t
){
virtual
void
push
(
TapeReadTask
*
t
){
m_tasks
.
push
(
t
);
}
};
...
...
@@ -79,11 +79,11 @@ TEST(castor_tape_tapeserver_daemon, RecallTaskInjectorNominal) {
for
(
int
i
=
0
;
i
<
1
;
++
i
)
{
DiskWriteTask
*
diskWriteTask
=
diskWrite
.
m_tasks
.
pop
();
TapeReadTask
Interface
*
tapeReadTask
=
tapeRead
.
m_tasks
.
pop
();
TapeReadTask
*
tapeReadTask
=
tapeRead
.
m_tasks
.
pop
();
//static_cast is needed otherwise compilation fails on SL5 with a raw NULL
ASSERT_EQ
(
static_cast
<
DiskWriteTask
*>
(
NULL
),
diskWriteTask
);
ASSERT_EQ
(
static_cast
<
TapeReadTask
Interface
*>
(
NULL
),
tapeReadTask
);
ASSERT_EQ
(
static_cast
<
TapeReadTask
*>
(
NULL
),
tapeReadTask
);
delete
diskWriteTask
;
delete
tapeReadTask
;
}
...
...
castor/tape/tapeserver/daemon/TapeReadSingleThread.hpp
View file @
cee91084
...
...
@@ -26,7 +26,7 @@
#include
"castor/tape/tapeserver/daemon/TapeSingleThreadInterface.hpp"
#include
"castor/tape/tapeserver/threading/BlockingQueue.hpp"
#include
"castor/tape/tapeserver/daemon/TapeReadTask
Interface
.hpp"
#include
"castor/tape/tapeserver/daemon/TapeReadTask.hpp"
#include
"castor/tape/tapeserver/threading/Threading.hpp"
#include
"castor/tape/tapeserver/drive/Drive.hpp"
#include
"castor/tape/tapeserver/file/File.hpp"
...
...
@@ -43,7 +43,7 @@ namespace daemon {
* This class will execute the different tape read tasks.
*
*/
class
TapeReadSingleThread
:
public
TapeSingleThreadInterface
<
TapeReadTask
Interface
>
{
class
TapeReadSingleThread
:
public
TapeSingleThreadInterface
<
TapeReadTask
>
{
public:
/**
* Constructor
...
...
@@ -56,7 +56,7 @@ public:
TapeReadSingleThread
(
castor
::
tape
::
drives
::
DriveInterface
&
drive
,
const
std
::
string
vid
,
uint64_t
maxFilesRequest
,
castor
::
log
::
LogContext
&
lc
)
:
TapeSingleThreadInterface
<
TapeReadTask
Interface
>
(
drive
,
vid
,
lc
),
TapeSingleThreadInterface
<
TapeReadTask
>
(
drive
,
vid
,
lc
),
m_maxFilesRequest
(
maxFilesRequest
),
m_filesProcessed
(
0
)
{}
/**
...
...
@@ -75,8 +75,8 @@ private:
* ask the task injector for more
* @return m_tasks.pop();
*/
TapeReadTask
Interface
*
popAndRequestMoreJobs
()
{
castor
::
tape
::
threading
::
BlockingQueue
<
TapeReadTask
Interface
*>::
valueRemainingPair
TapeReadTask
*
popAndRequestMoreJobs
()
{
castor
::
tape
::
threading
::
BlockingQueue
<
TapeReadTask
*>::
valueRemainingPair
vrp
=
m_tasks
.
popGetSize
();
// If we just passed (down) the half full limit, ask for more
// (the remaining value is after pop)
...
...
@@ -111,7 +111,7 @@ private:
// the task injector
while
(
1
)
{
// NULL indicated the end of work
TapeReadTask
Interface
*
task
=
popAndRequestMoreJobs
();
TapeReadTask
*
task
=
popAndRequestMoreJobs
();
m_logContext
.
log
(
LOG_DEBUG
,
"TapeReadThread: just got one more job"
);
if
(
task
)
{
task
->
execute
(
*
rs
,
m_logContext
);
...
...
castor/tape/tapeserver/daemon/TapeReadTask.hpp
View file @
cee91084
...
...
@@ -24,7 +24,7 @@
#pragma once
#include
"castor/tape/tapeserver/daemon/TapeReadTaskInterface.hpp"
#include
"castor/tape/tapeserver/daemon/DataFifo.hpp"
#include
"castor/tape/tapeserver/daemon/RecallMemoryManager.hpp"
#include
"castor/tape/tapeserver/daemon/DataConsumer.hpp"
...
...
@@ -40,7 +40,7 @@ namespace daemon {
* This class is in charge of
*
*/
class
TapeReadTask
:
public
TapeReadTaskInterface
{
class
TapeReadTask
{
public:
/**
* COnstructor
...
...
castor/tape/tapeserver/daemon/TapeWriteSingleThread.hpp
View file @
cee91084
...
...
@@ -38,7 +38,7 @@ namespace tape {
namespace
tapeserver
{
namespace
daemon
{
class
TapeWriteSingleThread
:
public
TapeSingleThreadInterface
<
TapeWriteTask
Interface
>
{
class
TapeWriteSingleThread
:
public
TapeSingleThreadInterface
<
TapeWriteTask
>
{
public:
/**
* Constructor
...
...
@@ -55,7 +55,7 @@ public:
const
std
::
string
&
vid
,
castor
::
log
::
LogContext
&
lc
,
MigrationReportPacker
&
repPacker
,
uint64_t
filesBeforeFlush
,
uint64_t
bytesBeforeFlush
)
:
TapeSingleThreadInterface
<
TapeWriteTask
Interface
>
(
drive
,
vid
,
lc
),
TapeSingleThreadInterface
<
TapeWriteTask
>
(
drive
,
vid
,
lc
),
m_filesBeforeFlush
(
filesBeforeFlush
),
m_bytesBeforeFlush
(
bytesBeforeFlush
),
m_drive
(
drive
),
m_reportPacker
(
repPacker
),
m_vid
(
vid
),
...
...
@@ -130,7 +130,7 @@ private:
uint64_t
bytes
=
0
;
uint64_t
files
=
0
;
std
::
auto_ptr
<
TapeWriteTask
Interface
>
task
;
std
::
auto_ptr
<
TapeWriteTask
>
task
;
while
(
1
)
{
//get a task
...
...
castor/tape/tapeserver/daemon/TapeWriteTask.cpp
View file @
cee91084
...
...
@@ -31,7 +31,7 @@
#include
"castor/tape/tapeserver/file/File.hpp"
#include
"castor/tape/tapeserver/daemon/AutoReleaseBlock.hpp"
#include
"castor/tape/tapeserver/exception/Exception.hpp"
#include
"castor/tape/tapeserver/daemon/MigrationReportPacker.hpp"
namespace
castor
{
namespace
tape
{
...
...
castor/tape/tapeserver/daemon/TapeWriteTask.hpp
View file @
cee91084
...
...
@@ -24,7 +24,7 @@
#pragma once
#include
"castor/tape/tapeserver/daemon/TapeWriteTaskInterface.hpp"
#include
"castor/tape/tapeserver/daemon/DataFifo.hpp"
#include
"castor/tape/tapeserver/daemon/MemManager.hpp"
#include
"castor/tape/tapeserver/daemon/DataConsumer.hpp"
...
...
@@ -36,13 +36,15 @@ namespace tape {
namespace
tapeserver
{
namespace
daemon
{
class
MigrationReportPacker
;
/**
* The TapeWriteFileTask is responsible to write a single file onto tape as part of a migration
* session. Being a consumer of memory blocks, it inherits from the DataConsumer class. It also
* inherits several methods from the TapeWriteTask (TODO: do we really need this base class?).
*/
class
TapeWriteTask
:
public
TapeWriteTaskInterface
,
public
DataConsumer
{
class
TapeWriteTask
:
public
DataConsumer
{
public:
/**
* Constructor
...
...
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