diff --git a/tapeserver/castor/tape/tapeserver/daemon/DataTransferConfig.cpp b/tapeserver/castor/tape/tapeserver/daemon/DataTransferConfig.cpp index e35695d700b34f38f7c8f623d89fcd7b96e4701a..67cdbb9047aab6a43bbe8b9042c654d312beee22 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DataTransferConfig.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DataTransferConfig.cpp @@ -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( diff --git a/tapeserver/castor/tape/tapeserver/daemon/DataTransferConfig.hpp b/tapeserver/castor/tape/tapeserver/daemon/DataTransferConfig.hpp index 4bb1aa10b97725837dfcc974605b3e106b002c1c..69b377a846622c34f72463ab3a3d730a30cad58c 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DataTransferConfig.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DataTransferConfig.hpp @@ -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. diff --git a/tapeserver/castor/tape/tapeserver/daemon/DataTransferSession.cpp b/tapeserver/castor/tape/tapeserver/daemon/DataTransferSession.cpp index c58b9ed4e4334e294c92cdeda0b48e1a8c338f68..c65c4cb9b1779acafb15c2e8a302969e2271749d 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DataTransferSession.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DataTransferSession.cpp @@ -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, diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskReadTaskTest.cpp b/tapeserver/castor/tape/tapeserver/daemon/DiskReadTaskTest.cpp index 3881a5f650724d0415e584a8b4acf930a7b16504..500b0207144f73998dce84875ccf995fc6b8c7aa 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskReadTaskTest.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskReadTaskTest.cpp @@ -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); diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskReadThreadPool.cpp b/tapeserver/castor/tape/tapeserver/daemon/DiskReadThreadPool.cpp index 516e2841576b0dd5a5ae66ff3ef09e912b903084..1d6bfbc39651a5cad440a8fde8ac3974f7b54aed 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskReadThreadPool.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskReadThreadPool.cpp @@ -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), diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskReadThreadPool.hpp b/tapeserver/castor/tape/tapeserver/daemon/DiskReadThreadPool.hpp index 123e6e782b90f12844744fb6c49a6b956b0c3f38..9e83a941e69b20a93094447f56a0e922c2492423 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskReadThreadPool.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskReadThreadPool.hpp @@ -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 diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTaskTest.cpp b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTaskTest.cpp index 8e8b84b5a065d85dff14e090bcf924d3cb45c481..b50679f86f17e133ca267f01b9c38271a9bcd64f 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTaskTest.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTaskTest.cpp @@ -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)); diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPool.cpp b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPool.cpp index 42521a5379ed4c0d8480d0c4372043b3d9c043a3..dbb04ab06874eb7f12c5853f35ab67f9b5c050f5 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPool.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPool.cpp @@ -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) diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp index 94193dda84f02da84a50c660b031ca2d6e904b84..33d74d5e36d3ee3aecbf685cd6583794659b8e97 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp @@ -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 diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPoolTest.cpp b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPoolTest.cpp index 39ea059ba57f1276e003feb3dcbc4dad965587d0..35071ca2defe687af275aee290d87b8c5c0ef4f2 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPoolTest.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPoolTest.cpp @@ -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){ diff --git a/tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjectorTest.cpp b/tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjectorTest.cpp index 56a1c7071951a6032f597dd51ff4eac46cc845d1..5646002b9eea3a4c9a10a24c392e60aed4be8479 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjectorTest.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjectorTest.cpp @@ -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() {}; }; diff --git a/tapeserver/castor/tape/tapeserver/file/CryptoPPTest.cpp b/tapeserver/castor/tape/tapeserver/file/CryptoPPTest.cpp index 4c8925e327fe33e453c4b39b834a91b1f1752ba0..17db1545392c59d2cbf464b3745d7c7fc2ef4961 100644 --- a/tapeserver/castor/tape/tapeserver/file/CryptoPPTest.cpp +++ b/tapeserver/castor/tape/tapeserver/file/CryptoPPTest.cpp @@ -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 diff --git a/tapeserver/castor/tape/tapeserver/file/DiskFile.cpp b/tapeserver/castor/tape/tapeserver/file/DiskFile.cpp index fa2ea29660c0365461b1b677e7ee63593053ddd5..502a35aa13d065dba4de2a6a3c561b8c5072eb06 100644 --- a/tapeserver/castor/tape/tapeserver/file/DiskFile.cpp +++ b/tapeserver/castor/tape/tapeserver/file/DiskFile.cpp @@ -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; diff --git a/tapeserver/castor/tape/tapeserver/file/DiskFile.hpp b/tapeserver/castor/tape/tapeserver/file/DiskFile.hpp index 5c29bb91a4a07a2feb0154856137c757a269fcd2..5aa9518cc33224566f3770834a47adaccc4bbd71 100644 --- a/tapeserver/castor/tape/tapeserver/file/DiskFile.hpp +++ b/tapeserver/castor/tape/tapeserver/file/DiskFile.hpp @@ -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: diff --git a/tapeserver/castor/tape/tapeserver/file/FileTest.cpp b/tapeserver/castor/tape/tapeserver/file/FileTest.cpp index a4d323d2e4186e247afccc0e836c7511df084990..16dd23432ff3bf2965f658e6a7939fd854917b44 100644 --- a/tapeserver/castor/tape/tapeserver/file/FileTest.cpp +++ b/tapeserver/castor/tape/tapeserver/file/FileTest.cpp @@ -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"); diff --git a/tapeserver/daemon/DriveHandler.cpp b/tapeserver/daemon/DriveHandler.cpp index fda638a44bb8fc5f7750ab3901ee65cd811b20c7..a99a01a3089b9feeaa6de069e0f939cb39590d08 100644 --- a/tapeserver/daemon/DriveHandler.cpp +++ b/tapeserver/daemon/DriveHandler.cpp @@ -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 = "";