Commit 19a5d2ba authored by Eric Cano's avatar Eric Cano
Browse files

Removed the remote protocol notion as xroot access is not supported anymore.

This was used for switching between xroot and rfio in CASTOR. Rfio is not supported in CTA.
parent 95fc2af2
......@@ -79,8 +79,6 @@ castor::tape::tapeserver::daemon::DataTransferConfig
config.nbDiskThreads = castorConf.getConfEntInt(
"TapeServer", "NbDiskThreads",
castor::tape::tapeserver::daemon::TAPESERVER_NB_DISK_THREAD, log);
config.remoteFileProtocol = castorConf.getConfEntString(
"TapeServer", "RemoteFileProtocol", "RFIO", log);
config.xrootPrivateKey = castorConf.getConfEntString(
"TapeServer", "XrootPrivateKey", "/etc/castor/xrd_tape_key.pem", log);
config.xrootTimeout = castorConf.getConfEntInt(
......
......@@ -95,11 +95,6 @@ struct DataTransferConfig {
*/
uint32_t nbDiskThreads;
/**
* The remote transfer protocol to be used.
*/
std::string remoteFileProtocol;
/**
* The location of the file containing the private RSA key to be used when
* using XROOT as the remote transfer protocol.
......
......@@ -208,7 +208,6 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
rrp,
rwd,
lc,
m_castorConf.remoteFileProtocol,
m_castorConf.xrootPrivateKey,
m_castorConf.xrootTimeout);
RecallTaskInjector rti(mm, trst, dwtp, *retrieveMount,
......@@ -304,7 +303,6 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
m_castorConf.bulkRequestMigrationMaxBytes,
mwd,
lc,
m_castorConf.remoteFileProtocol,
m_castorConf.xrootPrivateKey,
m_castorConf.xrootTimeout);
MigrationTaskInjector mti(mm, drtp, twst, *archiveMount,
......
......@@ -134,7 +134,7 @@ namespace unitTests{
ftwt.pushDataBlock(new MemBlock(1,blockSize));
castor::tape::tapeserver::daemon::DiskReadTask drt(ftwt,&file,blockNeeded,flag);
castor::tape::file::RadosStriperPool striperPool;
DiskFileFactory fileFactory("RFIO", "", 0, striperPool);
DiskFileFactory fileFactory("", 0, striperPool);
castor::messages::TapeserverProxyDummy tspd;
MockMigrationWatchDog mmwd(1.0, 1.0, tspd, "", lc);
......
......@@ -38,9 +38,7 @@ namespace daemon {
//------------------------------------------------------------------------------
DiskReadThreadPool::DiskReadThreadPool(int nbThread, uint64_t maxFilesReq,uint64_t maxBytesReq,
castor::tape::tapeserver::daemon::MigrationWatchDog & migrationWatchDog,
cta::log::LogContext lc, const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath, uint16_t xrootTimeout) :
m_remoteFileProtocol(remoteFileProtocol),
cta::log::LogContext lc, const std::string & xrootPrivateKeyPath, uint16_t xrootTimeout) :
m_xrootPrivateKeyPath(xrootPrivateKeyPath),
m_xrootTimeout(xrootTimeout),
m_watchdog(migrationWatchDog),
......
......@@ -54,8 +54,8 @@ public:
*/
DiskReadThreadPool(int nbThread, uint64_t maxFilesReq,uint64_t maxBytesReq,
castor::tape::tapeserver::daemon::MigrationWatchDog & migrationWatchDog,
cta::log::LogContext lc, const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath, uint16_t xrootTimeout);
cta::log::LogContext lc, const std::string & xrootPrivateKeyPath,
uint16_t xrootTimeout);
/**
* Destructor.
......@@ -147,7 +147,7 @@ private:
public:
DiskReadWorkerThread(DiskReadThreadPool & parent):
m_parent(parent),m_threadID(parent.m_nbActiveThread++),m_lc(parent.m_lc),
m_diskFileFactory(parent.m_remoteFileProtocol, parent.m_xrootPrivateKeyPath,
m_diskFileFactory(parent.m_xrootPrivateKeyPath,
parent.m_xrootTimeout, parent.m_striperPool){
cta::log::LogContext::ScopedParam param(m_lc, cta::log::Param("threadID", m_threadID));
m_lc.log(cta::log::INFO,"DisReadThread created");
......@@ -190,11 +190,6 @@ private:
/** The queue of pointer to tasks to be executed. We own the tasks (they are
* deleted by the threads after execution) */
cta::threading::BlockingQueue<DiskReadTask *> m_tasks;
/**
* Parameter selecting the disk transfer protocol
*/
std::string m_remoteFileProtocol;
/**
* Parameter: path to xroot private key
......
......@@ -101,7 +101,7 @@ namespace unitTests{
MockRecallReportPacker report(&trm,lc);
RecallMemoryManager mm(10,100,lc);
castor::tape::file::RadosStriperPool striperPool;
DiskFileFactory fileFactory("RFIO","", 0, striperPool);
DiskFileFactory fileFactory("", 0, striperPool);
cta::MockRetrieveMount mrm;
std::unique_ptr<TestingRetrieveJob> fileToRecall(new TestingRetrieveJob(mrm));
......
......@@ -41,10 +41,8 @@ DiskWriteThreadPool::DiskWriteThreadPool(int nbThread,
RecallReportPacker& report,
RecallWatchDog& recallWatchDog,
cta::log::LogContext lc,
const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath,
uint16_t xrootTimeout):
m_remoteFileProtocol(remoteFileProtocol),
m_xrootPrivateKeyPath(xrootPrivateKeyPath),
m_xrootTimeout(xrootTimeout),
m_reporter(report),m_watchdog(recallWatchDog),m_lc(lc)
......
......@@ -57,17 +57,12 @@ 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,
RecallWatchDog& recallWatchDog,
cta::log::LogContext lc,
const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath,
uint16_t xrootTimeout);
/**
......@@ -113,7 +108,7 @@ private:
DiskWriteWorkerThread(DiskWriteThreadPool & manager):
m_threadID(manager.m_nbActiveThread++),m_parentThreadPool(manager),
m_lc(m_parentThreadPool.m_lc),
m_diskFileFactory(manager.m_remoteFileProtocol, manager.m_xrootPrivateKeyPath,
m_diskFileFactory(manager.m_xrootPrivateKeyPath,
manager.m_xrootTimeout, manager.m_striperPool)
{
// This thread Id will remain for the rest of the thread's lifetime (and
......@@ -183,11 +178,6 @@ private:
protected:
/** The (thread safe) queue of tasks */
cta::threading::BlockingQueue<DiskWriteTask*> m_tasks;
/**
* Parameter selecting the disk transfer protocol
*/
std::string m_remoteFileProtocol;
/**
* Parameter: path to xroot private key
......
......@@ -105,7 +105,7 @@ namespace unitTests{
castor::messages::TapeserverProxyDummy tspd;
RecallWatchDog rwd(1,1,tspd,"", lc);
DiskWriteThreadPool dwtp(2,report,rwd,lc,"RFIO","/dev/null", 0);
DiskWriteThreadPool dwtp(2,report,rwd,lc,"/dev/null", 0);
dwtp.startThreads();
for(int i=0;i<5;++i){
......
......@@ -94,7 +94,7 @@ namespace unitTests
FakeDiskWriteThreadPool(RecallReportPacker &rrp, RecallWatchDog &rwd,
cta::log::LogContext & lc):
DiskWriteThreadPool(1,rrp,
rwd,lc, "RFIO","/dev/null", 0){}
rwd,lc,"/dev/null", 0){}
virtual ~FakeDiskWriteThreadPool() {};
};
......
......@@ -165,7 +165,7 @@ namespace unitTests {
private:
virtual void run() {
castor::tape::file::RadosStriperPool striperPool;
castor::tape::diskFile::DiskFileFactory dff("xroot", m_keyPath, 0,
castor::tape::diskFile::DiskFileFactory dff(m_keyPath, 0,
striperPool);
for (int i=0; i<5; i++) {
// Read keys in parallel and in a loop to test MT protection of the
......
......@@ -39,8 +39,7 @@ namespace castor {
namespace tape {
namespace diskFile {
DiskFileFactory::DiskFileFactory(const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyFile, uint16_t xrootTimeout,
DiskFileFactory::DiskFileFactory(const std::string & xrootPrivateKeyFile, uint16_t xrootTimeout,
castor::tape::file::RadosStriperPool & striperPool):
m_NoURLLocalFile("^(localhost:|)(/.*)$"),
m_NoURLRemoteFile("^([^:]*:)(.*)$"),
......@@ -49,16 +48,10 @@ DiskFileFactory::DiskFileFactory(const std::string & remoteFileProtocol,
m_URLEosFile("^eos://(.*)$"),
m_URLXrootFile("^(root://.*)$"),
m_URLCephFile("^radosstriper:///([^:]+@[^:]+):(.*)$"),
m_remoteFileProtocol(remoteFileProtocol),
m_xrootPrivateKeyFile(xrootPrivateKeyFile),
m_xrootPrivateKeyLoaded(false),
m_xrootTimeout(xrootTimeout),
m_striperPool(striperPool)
{
// Lowercase the protocol string
std::transform(m_remoteFileProtocol.begin(), m_remoteFileProtocol.end(),
m_remoteFileProtocol.begin(), ::tolower);
}
m_striperPool(striperPool) {}
const CryptoPP::RSA::PrivateKey & DiskFileFactory::xrootPrivateKey() {
if(!m_xrootPrivateKeyLoaded) {
......@@ -228,8 +221,6 @@ WriteFile * DiskFileFactory::createWriteFile(const std::string& path) {
std::string("In DiskFileFactory::createWriteFile failed to parse URL: ")+path);
}
cta::threading::Mutex DiskFileFactory::g_rfioOptionsLock;
//==============================================================================
// LOCAL READ FILE
//==============================================================================
......@@ -287,7 +278,7 @@ void LocalWriteFile::close() {
if (m_closeTried) return;
m_closeTried=true;
cta::exception::Errnum::throwOnMinusOne(::close(m_fd),
std::string("In LocalWriteFile::close failed rfio_close() on ")+m_URL);
std::string("In LocalWriteFile::close failed close() on ")+m_URL);
}
LocalWriteFile::~LocalWriteFile() throw() {
......@@ -581,6 +572,10 @@ void EosWriteFile::write(const void *data, const size_t size) {
m_writePosition += size;
}
void EosWriteFile::setChecksum(uint32_t checksum) {
// Noop: this is only implemented for rados striper
}
void EosWriteFile::close() {
// Multiple close protection
if (m_closeTried) return;
......
......@@ -50,14 +50,12 @@ namespace castor {
/**
* Factory class deciding on the type of read/write file type
* based on the url passed and a config paramter.
* Currently, the parameter allows switching between RFIO and XROOT
* based on the url passed
*/
class DiskFileFactory {
typedef cta::utils::Regex Regex;
public:
DiskFileFactory(const std::string & remoteFileProtocol,
const std::string & xrootPrivateKey, uint16_t xrootTimeout,
DiskFileFactory(const std::string & xrootPrivateKey, uint16_t xrootTimeout,
castor::tape::file::RadosStriperPool & striperPool);
ReadFile * createReadFile(const std::string & path);
WriteFile * createWriteFile(const std::string & path);
......@@ -69,12 +67,10 @@ namespace castor {
Regex m_URLEosFile;
Regex m_URLXrootFile;
Regex m_URLCephFile;
std::string m_remoteFileProtocol;
std::string m_xrootPrivateKeyFile;
CryptoPP::RSA::PrivateKey m_xrootPrivateKey;
bool m_xrootPrivateKeyLoaded;
const uint16_t m_xrootTimeout;
static cta::threading::Mutex g_rfioOptionsLock;
castor::tape::file::RadosStriperPool & m_striperPool;
public:
......
......@@ -269,7 +269,7 @@ namespace unitTests {
char data1[block_size];
char data2[block_size];
castor::tape::file::RadosStriperPool striperPool;
castor::tape::diskFile::DiskFileFactory fileFactory("RFIO","", 0, striperPool);
castor::tape::diskFile::DiskFileFactory fileFactory("", 0, striperPool);
TempFile sourceFile;
sourceFile.randomFill(1000);
TempFile destinationFile(sourceFile.path()+"_dst");
......
......@@ -995,7 +995,6 @@ int DriveHandler::runChild() {
m_tapedConfig.archiveFlushBytesFiles.value().maxFiles;
dataTransferConfig.nbBufs = m_tapedConfig.bufferCount.value();
dataTransferConfig.nbDiskThreads = m_tapedConfig.nbDiskThreads.value();
dataTransferConfig.remoteFileProtocol = "XROOT";
dataTransferConfig.useLbp = true;
dataTransferConfig.xrootPrivateKey = "";
......
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