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

CASTOR-4739: tapeserverd should support localfile, rfio, xroot and rados...

CASTOR-4739: tapeserverd should support localfile, rfio, xroot and rados striper access for disk files

Moved the call to getConfEntString(XROOT, PrivateKey, /opt/xrootd/keys/key.pem one step up to allow
unit testing in environments without a castor.conf
parent 9d1f9f2b
......@@ -37,6 +37,7 @@
#include "castor/exception/Exception.hpp"
#include "castor/tape/tapeserver/SCSI/Device.hpp"
#include "castor/tape/utils/utils.hpp"
#include "castor/common/CastorConfiguration.hpp"
#include "h/log.h"
#include "h/serrno.h"
#include "h/stager_client_commandline.h"
......@@ -202,7 +203,9 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
DiskWriteThreadPool dwtp(m_castorConf.tapeserverdDiskThreads,
rrp,
lc,
m_castorConf.tapeserverdRemoteFileProtocol);
m_castorConf.tapeserverdRemoteFileProtocol,
castor::common::CastorConfiguration::getConfig().
getConfEntString("XROOT", "PrivateKey", "/opt/xrootd/keys/key.pem"));
RecallTaskInjector rti(mm, trst, dwtp, m_clientProxy,
m_castorConf.tapebridgeBulkRequestRecallMaxFiles,
m_castorConf.tapebridgeBulkRequestRecallMaxBytes,lc);
......@@ -293,7 +296,9 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
m_castorConf.tapebridgeBulkRequestMigrationMaxFiles,
m_castorConf.tapebridgeBulkRequestMigrationMaxBytes,
lc,
m_castorConf.tapeserverdRemoteFileProtocol);
m_castorConf.tapeserverdRemoteFileProtocol,
castor::common::CastorConfiguration::getConfig().
getConfEntString("XROOT", "PrivateKey", "/opt/xrootd/keys/key.pem"));
MigrationTaskInjector mti(mm, drtp, twst, m_clientProxy,
m_castorConf.tapebridgeBulkRequestMigrationMaxBytes,
m_castorConf.tapebridgeBulkRequestMigrationMaxFiles,lc);
......
......@@ -37,10 +37,9 @@ namespace daemon {
// DiskReadThreadPool constructor
//------------------------------------------------------------------------------
DiskReadThreadPool::DiskReadThreadPool(int nbThread, uint64_t maxFilesReq,uint64_t maxBytesReq,
castor::log::LogContext lc, const std::string & remoteFileProtocol) :
m_diskFileFactory(remoteFileProtocol,
castor::common::CastorConfiguration::getConfig().
getConfEntString("XROOT", "PrivateKey", "/opt/xrootd/keys/key.pem")),
castor::log::LogContext lc, const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath) :
m_diskFileFactory(remoteFileProtocol, xrootPrivateKeyPath),
m_lc(lc),m_maxFilesReq(maxFilesReq),
m_maxBytesReq(maxBytesReq), m_nbActiveThread(0) {
for(int i=0; i<nbThread; i++) {
......
......@@ -50,7 +50,8 @@ public:
* @param lc log context fpr logging purpose
*/
DiskReadThreadPool(int nbThread, uint64_t maxFilesReq,uint64_t maxBytesReq,
castor::log::LogContext lc, const std::string & remoteFileProtocol);
castor::log::LogContext lc, const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath);
/**
* Destructor.
......
......@@ -36,10 +36,9 @@ namespace daemon {
//------------------------------------------------------------------------------
DiskWriteThreadPool::DiskWriteThreadPool(int nbThread,
RecallReportPacker& report,castor::log::LogContext lc,
const std::string & remoteFileProtocol):
m_diskFileFactory(remoteFileProtocol,
castor::common::CastorConfiguration::getConfig().
getConfEntString("XROOT", "PrivateKey", "/opt/xrootd/keys/key.pem")),
const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath):
m_diskFileFactory(remoteFileProtocol,xrootPrivateKeyPath),
m_reporter(report),m_lc(lc)
{
m_lc.pushOrReplace(castor::log::Param("threadCount", nbThread));
......
......@@ -55,11 +55,17 @@ public:
* @param lc reference to a log context object that will be copied at
* construction time (and then copied further for each thread). There will
* be no side effect on the caller's logs.
* @param remoteFileProtocol a string describing how the bare (no URL)
* pathes to files should be interpreted. Default is RFIO, unless the string
* is "xroot" (with any case variation) in which case we would use Xroot as a
* protocol.
* @param xrootPrivateKeyPath the path to the xroot private key file.
*/
DiskWriteThreadPool(int nbThread,
RecallReportPacker& reportPacker,
castor::log::LogContext lc,
const std::string & remoteFileProtocol);
const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath);
/**
* 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,lc,"RFIO");
DiskWriteThreadPool dwtp(2,report,lc,"RFIO","/dev/null");
dwtp.startThreads();
castor::tape::tapegateway::FileToRecallStruct file;
......
......@@ -53,7 +53,7 @@ class FakeDiskWriteThreadPool: public DiskWriteThreadPool
public:
using DiskWriteThreadPool::m_tasks;
FakeDiskWriteThreadPool(castor::log::LogContext & lc):
DiskWriteThreadPool(1,*((RecallReportPacker*)NULL), lc, "RFIO"){}
DiskWriteThreadPool(1,*((RecallReportPacker*)NULL), lc, "RFIO","/dev/null"){}
virtual ~FakeDiskWriteThreadPool() {};
};
......
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