Commit 10b0f9f0 authored by David COME's avatar David COME
Browse files

Renamed TapeReadFileTask => TapeReadTask and TapeReadTask=> TapeReadTaskInterface

parent 8be23627
......@@ -23,7 +23,7 @@ namespace tapeserver{
namespace daemon {
RecallTaskInjector::RecallTaskInjector(RecallMemoryManager & mm,
TapeSingleThreadInterface<TapeReadTask> & tapeReader,
TapeSingleThreadInterface<TapeReadTaskInterface> & tapeReader,
DiskThreadPoolInterface<DiskWriteTaskInterface> & diskWriter,
client::ClientInterface& client,castor::log::LogContext lc) :
m_thread(*this),m_memManager(mm),
......@@ -68,8 +68,8 @@ void RecallTaskInjector::injectBulkRecalls(const std::vector<castor::tape::tapeg
new DiskWriteTask(
removeOwningList(dynamic_cast<tape::tapegateway::FileToRecallStruct*>((*it)->clone())),
m_memManager);
TapeReadFileTask * trt =
new TapeReadFileTask(
TapeReadTask * trt =
new TapeReadTask(
removeOwningList(
dynamic_cast<tape::tapegateway::FileToRecallStruct*>((*it)->clone())),
*dwt,
......
......@@ -29,7 +29,7 @@
#include "castor/tape/tapeserver/daemon/MemManager.hpp"
#include "castor/tape/tapeserver/daemon/TapeReadSingleThread.hpp"
#include "castor/tape/tapeserver/daemon/TapeReadFileTask.hpp"
#include "castor/tape/tapeserver/daemon/TapeReadTask.hpp"
#include "castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp"
#include "castor/tape/tapeserver/daemon/DiskWriteTask.hpp"
#include "castor/tape/tapeserver/daemon/TapeWriteTask.hpp"
......@@ -49,7 +49,7 @@ class RecallTaskInjector: public TaskInjector {
public:
RecallTaskInjector(RecallMemoryManager & mm,
TapeSingleThreadInterface<TapeReadTask> & tapeReader,
TapeSingleThreadInterface<TapeReadTaskInterface> & tapeReader,
DiskThreadPoolInterface<DiskWriteTaskInterface> & diskWriter,client::ClientInterface& client,
castor::log::LogContext lc);
......@@ -134,7 +134,7 @@ private:
RecallMemoryManager & m_memManager;
TapeSingleThreadInterface<TapeReadTask> & m_tapeReader;
TapeSingleThreadInterface<TapeReadTaskInterface> & m_tapeReader;
DiskThreadPoolInterface<DiskWriteTaskInterface> & m_diskWriter;
client::ClientInterface& m_client;
......
......@@ -32,14 +32,14 @@ public:
}
};
class FakeSingleTapeReadThread : public TapeSingleThreadInterface<TapeReadTask>
class FakeSingleTapeReadThread : public TapeSingleThreadInterface<TapeReadTaskInterface>
{
public:
using TapeSingleThreadInterface<TapeReadTask>::m_tasks;
using TapeSingleThreadInterface<TapeReadTaskInterface>::m_tasks;
FakeSingleTapeReadThread(castor::tape::drives::DriveInterface& drive,
const std::string & vid, castor::log::LogContext & lc):
TapeSingleThreadInterface<TapeReadTask>(drive, vid, lc){}
TapeSingleThreadInterface<TapeReadTaskInterface>(drive, vid, lc){}
~FakeSingleTapeReadThread(){
const unsigned int size= m_tasks.size();
......@@ -51,7 +51,7 @@ public:
{
m_tasks.push(NULL);
}
virtual void push(TapeReadTask* t){
virtual void push(TapeReadTaskInterface* t){
m_tasks.push(t);
}
};
......@@ -92,11 +92,11 @@ TEST(castor_tape_tapeserver_daemon, RecallTaskInjectorNominal) {
for(int i=0;i<1;++i)
{
DiskWriteTaskInterface* diskWriteTask=diskWrite.m_tasks.pop();
TapeReadTask* tapeReadTask=tapeRead.m_tasks.pop();
TapeReadTaskInterface* tapeReadTask=tapeRead.m_tasks.pop();
//static_cast is needed otherwise compilation fails on SL5 with a raw NULL
ASSERT_EQ(static_cast<DiskWriteTaskInterface*>(NULL),diskWriteTask);
ASSERT_EQ(static_cast<TapeReadTask*>(NULL),tapeReadTask);
ASSERT_EQ(static_cast<TapeReadTaskInterface*>(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/TapeReadTask.hpp"
#include "castor/tape/tapeserver/daemon/TapeReadTaskInterface.hpp"
#include "castor/tape/tapeserver/threading/Threading.hpp"
#include "castor/tape/tapeserver/drive/Drive.hpp"
#include "castor/tape/tapeserver/file/File.hpp"
......@@ -37,18 +37,18 @@ namespace castor {
namespace tape {
namespace tapeserver {
namespace daemon {
class TapeReadSingleThread : public TapeSingleThreadInterface<TapeReadTask>{
class TapeReadSingleThread : public TapeSingleThreadInterface<TapeReadTaskInterface>{
public:
TapeReadSingleThread(castor::tape::drives::DriveInterface & drive,
const std::string vid, uint64_t maxFilesRequest,
castor::log::LogContext & lc):
TapeSingleThreadInterface<TapeReadTask>(drive, vid, lc),
TapeSingleThreadInterface<TapeReadTaskInterface>(drive, vid, lc),
m_maxFilesRequest(maxFilesRequest) {}
void setTaskInjector(TaskInjector * ti) { m_taskInjector = ti; }
private:
TapeReadTask * popAndRequestMoreJobs() {
castor::tape::threading::BlockingQueue<TapeReadTask *>::valueRemainingPair
TapeReadTaskInterface * popAndRequestMoreJobs() {
castor::tape::threading::BlockingQueue<TapeReadTaskInterface *>::valueRemainingPair
vrp = m_tasks.popGetSize();
// If we just passed (down) the half full limit, ask for more
// (the remaining value is after pop)
......@@ -81,7 +81,7 @@ private:
// the task injector
while(1) {
// NULL indicated the end of work
TapeReadTask * task = popAndRequestMoreJobs();
TapeReadTaskInterface * task = popAndRequestMoreJobs();
m_logContext.log(LOG_DEBUG, "TapeReadThread: just got one more job");
if (task) {
task->execute(*rs, m_logContext);
......
/******************************************************************************
* TapeReadFileTask.hpp
* TapeReadTask.hpp
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
......@@ -24,7 +24,7 @@
#pragma once
#include "castor/tape/tapeserver/daemon/TapeReadTask.hpp"
#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"
......@@ -35,9 +35,9 @@ namespace castor {
namespace tape {
namespace tapeserver {
namespace daemon {
class TapeReadFileTask: public TapeReadTask {
class TapeReadTask: public TapeReadTaskInterface {
public:
TapeReadFileTask(castor::tape::tapegateway::FileToRecallStruct * ftr,
TapeReadTask(castor::tape::tapegateway::FileToRecallStruct * ftr,
DataConsumer & destination, RecallMemoryManager & mm):
m_fileToRecall(ftr), m_fifo(destination), m_mm(mm) {}
......
/******************************************************************************
* TapeReadTask.hpp
* TapeReadTaskInterface.hpp
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
......@@ -32,13 +32,13 @@ namespace castor {
namespace tape {
namespace tapeserver {
namespace daemon {
class TapeReadTask {
class TapeReadTaskInterface {
public:
virtual void execute(castor::tape::tapeFile::ReadSession & /*rs*/,
castor::log::LogContext & /*lc*/) {
throw MemException("Tring to execute a non-execuatble TapeReadTask");
};
virtual ~TapeReadTask() {}
virtual ~TapeReadTaskInterface() {}
};
}
}
......
......@@ -30,7 +30,7 @@
#include "castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp"
#include "castor/tape/tapeserver/daemon/DiskWriteTask.hpp"
#include "castor/tape/tapeserver/daemon/TapeReadSingleThread.hpp"
#include "castor/tape/tapeserver/daemon/TapeReadFileTask.hpp"
#include "castor/tape/tapeserver/daemon/TapeReadTask.hpp"
#include "castor/tape/tapeserver/daemon/RecallTaskInjector.hpp"
#include "castor/tape/tapeserver/drive/Drive.hpp"
#include <memory>
......
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