Commit 52be1f30 authored by David COME's avatar David COME
Browse files

Removed the TaskInjector that was there for circular dependancy problem wnd which is now solved

parent 96162d75
......@@ -27,7 +27,7 @@
#include "castor/tape/tapeserver/threading/BlockingQueue.hpp"
#include "castor/tape/tapeserver/threading/Threading.hpp"
#include "castor/tape/tapeserver/threading/AtomicCounter.hpp"
#include "castor/tape/tapeserver/daemon/TaskInjector.hpp"
#include "castor/log/LogContext.hpp"
#include "castor/tape/tapeserver/utils/suppressUnusedVariable.hpp"
#include "castor/tape/tapeserver/daemon/RecallReportPacker.hpp"
......
......@@ -24,7 +24,7 @@ namespace unitTests{
RecallReportPacker(client,1,lc){}
};
struct MockTaskInjector : public TaskInjector{
struct MockTaskInjector : public RecallTaskInjector{
MOCK_METHOD3(requestInjection, void(int maxFiles, int maxBlocks, bool lastCall));
};
......
......@@ -37,6 +37,7 @@
#include "castor/tape/tapeserver/drive/Drive.hpp"
#include "RecallTaskInjector.hpp"
#include "RecallReportPacker.hpp"
#include "castor/tape/tapeserver/file/File.hpp"
using namespace castor::tape;
using namespace castor::log;
......
......@@ -33,7 +33,7 @@
#include "castor/tape/tapegateway/FileToMigrateStruct.hpp"
#include "castor/tape/tapeserver/client/ClientInterface.hpp"
#include "castor/log/LogContext.hpp"
#include "castor/tape/tapeserver/daemon/TaskInjector.hpp"
#include "castor/tape/tapeserver/threading/AtomicCounter.hpp"
namespace castor{
namespace tape{
......@@ -43,7 +43,7 @@ namespace daemon {
/**
* This classis responsible for creating the tasks in case of a recall job
*/
class MigrationTaskInjector: public TaskInjector {
class MigrationTaskInjector /*: public TaskInjector*/ {
public:
/**
......
......@@ -42,6 +42,7 @@
#include "MigrationTaskInjector.hpp"
#include "castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp"
#include "castor/tape/tapeserver/daemon/GlobalStatusReporter.hpp"
#include "castor/tape/tapeserver/daemon/TapeReadSingleThread.hpp"
using namespace castor::tape;
using namespace castor::log;
......
......@@ -9,6 +9,7 @@
#include "castor/tape/tapeserver/client/ClientProxy.hpp"
#include "castor/tape/tapeserver/client/ClientInterface.hpp"
#include "log.h"
#include "castor/tape/tapeserver/daemon/TapeReadSingleThread.hpp"
#include <stdint.h>
using castor::log::LogContext;
......@@ -44,6 +45,11 @@ RecallTaskInjector::RecallTaskInjector(RecallMemoryManager & mm,
m_client(client),m_lc(lc),m_maxFiles(maxFiles),m_byteSizeThreshold(byteSizeThreshold)
{}
//------------------------------------------------------------------------------
//destructor
//------------------------------------------------------------------------------
RecallTaskInjector::~RecallTaskInjector(){
}
//------------------------------------------------------------------------------
//finish
//------------------------------------------------------------------------------
......
......@@ -25,8 +25,10 @@
#pragma once
#include <stdint.h>
#include "castor/tape/tapeserver/daemon/TapeReadSingleThread.hpp"
#include "castor/log/LogContext.hpp"
#include "castor/tape/tapeserver/threading/BlockingQueue.hpp"
#include "castor/tape/tapeserver/threading/Threading.hpp"
namespace castor{
namespace tape{
//forward declarations
......@@ -38,14 +40,18 @@ namespace tapeserver{
class ClientInterface;
}
namespace daemon {
//forward declaration
class RecallMemoryManager;
class DiskWriteThreadPool;
class TapeReadTask;
//forward declaration of template class
template <class T> class TapeSingleThreadInterface;
/**
* This classis responsible for creating the tasks in case of a recall job
*/
class RecallTaskInjector: public TaskInjector {
class RecallTaskInjector /*: public TaskInjector*/ {
public:
/**
* Constructor
......@@ -65,12 +71,13 @@ public:
DiskWriteThreadPool & diskWriter,client::ClientInterface& client,
uint64_t maxFiles, uint64_t byteSizeThreshold,castor::log::LogContext lc);
virtual ~RecallTaskInjector();
/**
* Function for a feed-back loop purpose between RecallTaskInjector and
* TapeReadSingleThread. When TapeReadSingleThread::popAndRequestMoreJobs detects
* it has not enough jobs to do to, it is class to push a request
* in order to (try) fill up the queue.
* it has not enough jobs to do to, it will push a request, that when executed
* will ask the client to try to fill up the queue.
* @param lastCall true if we want the new request to be a last call.
* See Request::lastCall
......
......@@ -34,6 +34,7 @@
#include <iostream>
#include <stdio.h>
#include <memory>
#include "castor/tape/tapeserver/daemon/RecallTaskInjector.hpp"
namespace castor {
namespace tape {
......@@ -70,7 +71,7 @@ public:
* because there is a dependency
* @param ti the task injector
*/
void setTaskInjector(TaskInjector * ti) {
void setTaskInjector(RecallTaskInjector * ti) {
m_taskInjector = ti;
}
......@@ -146,7 +147,7 @@ private:
const uint64_t m_maxFilesRequest;
///a pointer to task injector, thus we can ask him for more tasks
castor::tape::tapeserver::daemon::TaskInjector * m_taskInjector;
castor::tape::tapeserver::daemon::RecallTaskInjector * m_taskInjector;
///how many files have we already processed(for loopback purpose)
size_t m_filesProcessed;
......
......@@ -10,7 +10,7 @@
#include "castor/tape/tapeserver/threading/Threading.hpp"
#include "castor/tape/tapeserver/threading/BlockingQueue.hpp"
#include "castor/tape/tapeserver/drive/Drive.hpp"
#include "castor/tape/tapeserver/daemon/TaskInjector.hpp"
#include "castor/log/LogContext.hpp"
namespace castor {
......
/******************************************************************************
* JobInjector.hpp
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#pragma once
namespace castor {
namespace tape {
namespace tapeserver {
namespace daemon {
class TaskInjector{
public:
virtual void requestInjection(bool lastCall) = 0;
virtual void finish() = 0;
virtual ~TaskInjector() {}
};
}
}
}
}
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