Commit dde6877c authored by Eric Cano's avatar Eric Cano
Browse files

Added a new m_moverHandlerPort member to the diskFileFactory class, so the new...

Added a new m_moverHandlerPort member to the diskFileFactory class, so the new xroot-c2fs URLs can be implemented.
Propagated the value from castor.conf through the constructors of the DiskThreadPools and the DataTranferSessions.
parent dfee7f47
......@@ -215,7 +215,8 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
rwd,
lc,
m_castorConf.remoteFileProtocol,
m_castorConf.xrootPrivateKey);
m_castorConf.xrootPrivateKey,
m_castorConf.moverHandlerPort);
RecallTaskInjector rti(mm, trst, dwtp, m_clientProxy,
m_castorConf.bulkRequestRecallMaxFiles,
m_castorConf.bulkRequestRecallMaxBytes,lc);
......@@ -312,7 +313,8 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
mwd,
lc,
m_castorConf.remoteFileProtocol,
m_castorConf.xrootPrivateKey);
m_castorConf.xrootPrivateKey,
m_castorConf.moverHandlerPort);
MigrationTaskInjector mti(mm, drtp, twst, m_clientProxy,
m_castorConf.bulkRequestMigrationMaxFiles,
m_castorConf.bulkRequestMigrationMaxBytes,lc);
......
......@@ -39,8 +39,9 @@ namespace daemon {
DiskReadThreadPool::DiskReadThreadPool(int nbThread, uint64_t maxFilesReq,uint64_t maxBytesReq,
castor::tape::tapeserver::daemon::MigrationWatchDog & migrationWatchDog,
castor::log::LogContext lc, const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath) :
m_diskFileFactory(remoteFileProtocol, xrootPrivateKeyPath),
const std::string & xrootPrivateKeyPath,
uint16_t moverHandlerPort) :
m_diskFileFactory(remoteFileProtocol, xrootPrivateKeyPath, moverHandlerPort),
m_watchdog(migrationWatchDog),
m_lc(lc),m_maxFilesReq(maxFilesReq),
m_maxBytesReq(maxBytesReq), m_nbActiveThread(0) {
......
......@@ -54,7 +54,7 @@ public:
DiskReadThreadPool(int nbThread, uint64_t maxFilesReq,uint64_t maxBytesReq,
castor::tape::tapeserver::daemon::MigrationWatchDog & migrationWatchDog,
castor::log::LogContext lc, const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath);
const std::string & xrootPrivateKeyPath, uint16_t moverHandlerPort);
/**
* Destructor.
......
......@@ -60,7 +60,7 @@ namespace unitTests{
MockRecallReportPacker report(client,lc);
EXPECT_CALL(report,reportFailedJob(_,_,_));
RecallMemoryManager mm(10,100,lc);
DiskFileFactory fileFactory("RFIO","");
DiskFileFactory fileFactory("RFIO","",0);
castor::tape::tapegateway::FileToRecallStruct file;
file.setPath("/dev/null");
......
......@@ -43,8 +43,9 @@ DiskWriteThreadPool::DiskWriteThreadPool(int nbThread,
RecallWatchDog& recallWatchDog,
castor::log::LogContext lc,
const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath):
m_diskFileFactory(remoteFileProtocol,xrootPrivateKeyPath),
const std::string & xrootPrivateKeyPath,
uint16_t moverHandlerPort):
m_diskFileFactory(remoteFileProtocol,xrootPrivateKeyPath,moverHandlerPort),
m_reporter(report),m_watchdog(recallWatchDog),m_lc(lc)
{
m_lc.pushOrReplace(castor::log::Param("threadCount", nbThread));
......
......@@ -68,7 +68,8 @@ public:
RecallWatchDog& recallWatchDog,
castor::log::LogContext lc,
const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath);
const std::string & xrootPrivateKeyPath,
uint16_t moverHandlerPort);
/**
* Destructor: we suppose the threads are no running (waitThreads() should
* be called befor destruction unless the threads were not started.
......
......@@ -63,7 +63,7 @@ namespace unitTests{
RecallMemoryManager mm(10,100,lc);
DiskWriteThreadPool dwtp(2,report,*((RecallWatchDog*)NULL),lc,"RFIO","/dev/null");
DiskWriteThreadPool dwtp(2,report,*((RecallWatchDog*)NULL),lc,"RFIO","/dev/null",0);
dwtp.startThreads();
castor::tape::tapegateway::FileToRecallStruct file;
......
......@@ -54,7 +54,7 @@ public:
using DiskWriteThreadPool::m_tasks;
FakeDiskWriteThreadPool(castor::log::LogContext & lc):
DiskWriteThreadPool(1,*((RecallReportPacker*)NULL),
*((RecallWatchDog*)NULL),lc, "RFIO","/dev/null"){}
*((RecallWatchDog*)NULL),lc, "RFIO","/dev/null",0){}
virtual ~FakeDiskWriteThreadPool() {};
};
......
......@@ -41,7 +41,7 @@ namespace tape {
namespace diskFile {
DiskFileFactory::DiskFileFactory(const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyFile):
const std::string & xrootPrivateKeyFile, uint16_t moverHandlerPort):
m_NoURLLocalFile("^(localhost:|)(/.*)$"),
m_NoURLRemoteFile("^(.*:)(/.*)$"),
m_NoURLRadosStriperFile("^localhost:([^/]+)/(.*)$"),
......@@ -51,7 +51,8 @@ DiskFileFactory::DiskFileFactory(const std::string & remoteFileProtocol,
m_URLCephFile("^radosStriper://(.*)$"),
m_remoteFileProtocol(remoteFileProtocol),
m_xrootPrivateKeyFile(xrootPrivateKeyFile),
m_xrootPrivateKeyLoaded(false)
m_xrootPrivateKeyLoaded(false),
m_moverHandlerPort(moverHandlerPort)
{
// Lowercase the protocol string
std::transform(m_remoteFileProtocol.begin(), m_remoteFileProtocol.end(),
......
......@@ -26,6 +26,7 @@
#include "castor/tape/tapeserver/utils/Regex.hpp"
#include <cryptopp/rsa.h>
#include <memory>
#include <stdint.h>
/*
* This file only contains the interface declaration of the base classes
* the real implementation, which depends on many includes is hidden in
......@@ -52,7 +53,8 @@ namespace castor {
typedef castor::tape::utils::Regex Regex;
public:
DiskFileFactory(const std::string & remoteFileProtocol,
const std::string & xrootPrivateKey);
const std::string & xrootPrivateKey,
uint16_t moverHandlerPort);
ReadFile * createReadFile(const std::string & path);
WriteFile * createWriteFile(const std::string & path);
private:
......@@ -67,6 +69,7 @@ namespace castor {
std::string m_xrootPrivateKeyFile;
CryptoPP::RSA::PrivateKey m_xrootPrivateKey;
bool m_xrootPrivateKeyLoaded;
uint16_t m_moverHandlerPort;
/** Return the private key. Read it from the file if necessary. */
const CryptoPP::RSA::PrivateKey & xrootPrivateKey();
......
......@@ -217,7 +217,7 @@ namespace UnitTests {
const uint32_t block_size = 1024;
char data1[block_size];
char data2[block_size];
castor::tape::diskFile::DiskFileFactory fileFactory("RFIO","");
castor::tape::diskFile::DiskFileFactory fileFactory("RFIO","",0);
{
std::auto_ptr<castor::tape::diskFile::ReadFile> rf(
fileFactory.createReadFile("localhost:/etc/fstab"));
......
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