Commit cee91084 authored by David COME's avatar David COME
Browse files

Suppressed TapeWriteTaskInterface and TapeReadTaskInterface

parent 2ff57d7f
......@@ -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 {
......
......@@ -54,7 +54,7 @@ namespace daemon {
//------------------------------------------------------------------------------
MigrationTaskInjector::MigrationTaskInjector(MigrationMemoryManager & mm,
DiskReadThreadPool & diskReader,
TapeSingleThreadInterface<TapeWriteTaskInterface> & 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),
......
......@@ -63,7 +63,7 @@ public:
*/
MigrationTaskInjector(MigrationMemoryManager & mm,
DiskReadThreadPool & diskReader,
TapeSingleThreadInterface<TapeWriteTaskInterface> & 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<TapeWriteTaskInterface>& m_tapeWriter;
TapeSingleThreadInterface<TapeWriteTask>& m_tapeWriter;
///the one object that will hold all the threads which will be executing
///disk-reading tasks
......
......@@ -35,7 +35,7 @@ namespace tapeserver{
namespace daemon {
RecallTaskInjector::RecallTaskInjector(RecallMemoryManager & mm,
TapeSingleThreadInterface<TapeReadTaskInterface> & tapeReader,
TapeSingleThreadInterface<TapeReadTask> & tapeReader,
DiskWriteThreadPool & diskWriter,
client::ClientInterface& client,
uint64_t maxFiles, uint64_t byteSizeThreshold,castor::log::LogContext lc) :
......
......@@ -42,7 +42,7 @@ namespace daemon {
class RecallMemoryManager;
class DiskWriteThreadPool;
class TapeReadTaskInterface;
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<TapeReadTaskInterface> & 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<TapeReadTaskInterface> & m_tapeReader;
TapeSingleThreadInterface<TapeReadTask> & m_tapeReader;
///the one object that will hold all the threads which will be executing
///disk-writing tasks
......
......@@ -20,14 +20,14 @@ public:
virtual ~FakeDiskWriteThreadPool() {};
};
class FakeSingleTapeReadThread : public TapeSingleThreadInterface<TapeReadTaskInterface>
class FakeSingleTapeReadThread : public TapeSingleThreadInterface<TapeReadTask>
{
public:
using TapeSingleThreadInterface<TapeReadTaskInterface>::m_tasks;
using TapeSingleThreadInterface<TapeReadTask>::m_tasks;
FakeSingleTapeReadThread(castor::tape::drives::DriveInterface& drive,
const std::string & vid, castor::log::LogContext & lc):
TapeSingleThreadInterface<TapeReadTaskInterface>(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(TapeReadTaskInterface* 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();
TapeReadTaskInterface* 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<TapeReadTaskInterface*>(NULL),tapeReadTask);
ASSERT_EQ(static_cast<TapeReadTask*>(NULL),tapeReadTask);
delete diskWriteTask;
delete tapeReadTask;
}
......
......@@ -26,7 +26,7 @@
#include "castor/tape/tapeserver/daemon/TapeSingleThreadInterface.hpp"
#include "castor/tape/tapeserver/threading/BlockingQueue.hpp"
#include "castor/tape/tapeserver/daemon/TapeReadTaskInterface.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<TapeReadTaskInterface>{
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<TapeReadTaskInterface>(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();
*/
TapeReadTaskInterface * popAndRequestMoreJobs() {
castor::tape::threading::BlockingQueue<TapeReadTaskInterface *>::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
TapeReadTaskInterface * task = popAndRequestMoreJobs();
TapeReadTask * task = popAndRequestMoreJobs();
m_logContext.log(LOG_DEBUG, "TapeReadThread: just got one more job");
if (task) {
task->execute(*rs, m_logContext);
......
......@@ -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
......
......@@ -38,7 +38,7 @@ namespace tape {
namespace tapeserver {
namespace daemon {
class TapeWriteSingleThread : public TapeSingleThreadInterface<TapeWriteTaskInterface> {
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<TapeWriteTaskInterface>(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<TapeWriteTaskInterface> task ;
std::auto_ptr<TapeWriteTask> task ;
while(1) {
//get a task
......
......@@ -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 {
......
......@@ -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
......
Markdown is supported
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