Commit 27a9d90a authored by Victor Kotlyar's avatar Victor Kotlyar
Browse files

Ported commit 32abe64b77df4cd0232e91b02b5feb4e4bb28652 from castor/master

Added a configuration parameter for Xrootd timeouts in tapeserverd.
parent f1f130dd
......@@ -533,6 +533,9 @@
# URLs.
#TapeServer XrootPrivateKey /etc/castor/xrd_tape_key.pem
# The timeout to use for Xroot functions. Default to 0 for no timeout.
#TapeServer XrootTimeout 0
# Number of memory buffers in the data-transfer cache.
#TapeServer NbBufs 300
......
......@@ -83,6 +83,8 @@ castor::tape::tapeserver::daemon::DataTransferConfig
"TapeServer", "RemoteFileProtocol", "RFIO", log);
config.xrootPrivateKey = castorConf.getConfEntString(
"TapeServer", "XrootPrivateKey", "/etc/castor/xrd_tape_key.pem", log);
config.xrootTimeout = castorConf.getConfEntInt(
"TapeServer", "XrootTimeout", 0, log);
const std::string useLBP = castorConf.getConfEntString(
"TapeServer", "UseLogicalBlockProtection", "no", log);
......
......@@ -106,6 +106,11 @@ struct DataTransferConfig {
*/
std::string xrootPrivateKey;
/**
* The timeout for all the xroot functions. The default is 0 (no timeout)
*/
uint16_t xrootTimeout;
/**
* The boolean variable describing to use on not to use Logical
* Block Protection.
......
......@@ -161,7 +161,8 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
rwd,
lc,
m_castorConf.remoteFileProtocol,
m_castorConf.xrootPrivateKey);
m_castorConf.xrootPrivateKey,
m_castorConf.xrootTimeout);
RecallTaskInjector rti(mm, trst, dwtp, *retrieveMount,
m_castorConf.bulkRequestRecallMaxFiles,
m_castorConf.bulkRequestRecallMaxBytes,lc);
......@@ -255,7 +256,8 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
mwd,
lc,
m_castorConf.remoteFileProtocol,
m_castorConf.xrootPrivateKey);
m_castorConf.xrootPrivateKey,
m_castorConf.xrootTimeout);
MigrationTaskInjector mti(mm, drtp, twst, *archiveMount,
m_castorConf.bulkRequestMigrationMaxFiles,
m_castorConf.bulkRequestMigrationMaxBytes,lc);
......
......@@ -132,7 +132,7 @@ namespace unitTests{
FakeTapeWriteTask ftwt;
ftwt.pushDataBlock(new MemBlock(1,blockSize));
castor::tape::tapeserver::daemon::DiskReadTask drt(ftwt,&file,blockNeeded,flag);
DiskFileFactory fileFactory("RFIO","");
DiskFileFactory fileFactory("RFIO","", 0);
castor::messages::TapeserverProxyDummy tspd;
MockMigrationWatchDog mmwd(1.0, 1.0, tspd, "", lc);
drt.execute(lc,fileFactory,mmwd);
......
......@@ -39,8 +39,8 @@ 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) :
m_diskFileFactory(remoteFileProtocol, xrootPrivateKeyPath),
const std::string & xrootPrivateKeyPath, uint16_t xrootTimeout) :
m_diskFileFactory(remoteFileProtocol, xrootPrivateKeyPath, xrootTimeout),
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,
cta::log::LogContext lc, const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath);
const std::string & xrootPrivateKeyPath, uint16_t xrootTimeout);
/**
* Destructor.
......
......@@ -101,7 +101,7 @@ namespace unitTests{
TestingRetrieveMount trm(std::move(dbrm));
MockRecallReportPacker report(&trm,lc);
RecallMemoryManager mm(10,100,lc);
DiskFileFactory fileFactory("RFIO","");
DiskFileFactory fileFactory("RFIO","", 0);
cta::MockRetrieveMount mrm;
std::unique_ptr<TestingRetrieveJob> fileToRecall(new TestingRetrieveJob(mrm));
......
......@@ -42,8 +42,9 @@ DiskWriteThreadPool::DiskWriteThreadPool(int nbThread,
RecallWatchDog& recallWatchDog,
cta::log::LogContext lc,
const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath):
m_diskFileFactory(remoteFileProtocol,xrootPrivateKeyPath),
const std::string & xrootPrivateKeyPath,
uint16_t xrootTimeout):
m_diskFileFactory(remoteFileProtocol, xrootPrivateKeyPath, xrootTimeout),
m_reporter(report),m_watchdog(recallWatchDog),m_lc(lc)
{
m_lc.pushOrReplace(cta::log::Param("threadCount", nbThread));
......
......@@ -68,7 +68,8 @@ public:
RecallWatchDog& recallWatchDog,
cta::log::LogContext lc,
const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyPath);
const std::string & xrootPrivateKeyPath,
uint16_t xrootTimeout);
/**
* Destructor: we suppose the threads are no running (waitThreads() should
* be called befor destruction unless the threads were not started.
......
......@@ -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");
DiskWriteThreadPool dwtp(2,report,rwd,lc,"RFIO","/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"){}
rwd,lc, "RFIO","/dev/null", 0){}
virtual ~FakeDiskWriteThreadPool() {};
};
......
......@@ -163,7 +163,7 @@ namespace unitTests {
}
private:
virtual void run() {
castor::tape::diskFile::DiskFileFactory dff("xroot", m_keyPath);
castor::tape::diskFile::DiskFileFactory dff("xroot", m_keyPath, 0);
for (int i=0; i<5; i++) {
// Read keys in parallel and in a loop to test MT protection of the
// key reading, not protected here.
......
......@@ -38,7 +38,7 @@ namespace tape {
namespace diskFile {
DiskFileFactory::DiskFileFactory(const std::string & remoteFileProtocol,
const std::string & xrootPrivateKeyFile):
const std::string & xrootPrivateKeyFile, uint16_t xrootTimeout):
m_NoURLLocalFile("^(localhost:|)(/.*)$"),
m_NoURLRemoteFile("^([^:]*:)(.*)$"),
m_NoURLRadosStriperFile("^localhost:([^/]+)/(.*)$"),
......@@ -48,7 +48,8 @@ DiskFileFactory::DiskFileFactory(const std::string & remoteFileProtocol,
m_URLCephFile("^radosStriper://(.*)$"),
m_remoteFileProtocol(remoteFileProtocol),
m_xrootPrivateKeyFile(xrootPrivateKeyFile),
m_xrootPrivateKeyLoaded(false)
m_xrootPrivateKeyLoaded(false),
m_xrootTimeout(xrootTimeout)
{
// Lowercase the protocol string
std::transform(m_remoteFileProtocol.begin(), m_remoteFileProtocol.end(),
......@@ -140,7 +141,7 @@ ReadFile * DiskFileFactory::createReadFile(const std::string& path) {
// Xroot URL?
regexResult = m_URLXrootFile.exec(path);
if (regexResult.size()) {
return new XrootReadFile(regexResult[1]);
return new XrootReadFile(regexResult[1], m_xrootTimeout);
}
// radosStriper URL?
regexResult = m_URLCephFile.exec(path);
......@@ -159,14 +160,14 @@ ReadFile * DiskFileFactory::createReadFile(const std::string& path) {
// In the current CASTOR implementation, the xrootd port is hard coded to 1095
return new XrootC2FSReadFile(
std::string("root://") + regexResult[1] + "1095/" + regexResult[2],
xrootPrivateKey());
xrootPrivateKey(), m_xrootTimeout);
}
// Do we have a radosStriper file?
regexResult = m_NoURLRadosStriperFile.exec(path);
if (regexResult.size()) {
return new XrootC2FSReadFile(
std::string("root://localhost:1095/")+regexResult[1]+"/"+regexResult[2],
xrootPrivateKey(), regexResult[1]);
xrootPrivateKey(), m_xrootTimeout, regexResult[1]);
}
throw cta::exception::Exception(
std::string("In DiskFileFactory::createReadFile failed to parse URL: ")+path);
......@@ -187,7 +188,7 @@ WriteFile * DiskFileFactory::createWriteFile(const std::string& path) {
// Xroot URL?
regexResult = m_URLXrootFile.exec(path);
if (regexResult.size()) {
return new XrootWriteFile(regexResult[1]);
return new XrootWriteFile(regexResult[1], m_xrootTimeout);
}
// radosStriper URL?
regexResult = m_URLCephFile.exec(path);
......@@ -206,14 +207,14 @@ WriteFile * DiskFileFactory::createWriteFile(const std::string& path) {
// In the current CASTOR implementation, the xrootd port is hard coded to 1095
return new XrootC2FSWriteFile(
std::string("root://") + regexResult[1] + "1095/" + regexResult[2],
xrootPrivateKey());
xrootPrivateKey(), m_xrootTimeout);
}
// Do we have a radosStriper file?
regexResult = m_NoURLRadosStriperFile.exec(path);
if (regexResult.size()) {
return new XrootC2FSWriteFile(
std::string("root://localhost:1095/")+regexResult[1]+"/"+regexResult[2],
xrootPrivateKey(), regexResult[1]);
xrootPrivateKey(), m_xrootTimeout, regexResult[1]);
}
throw cta::exception::Exception(
std::string("In DiskFileFactory::createWriteFile failed to parse URL: ")+path);
......@@ -312,8 +313,8 @@ std::string CryptoPPSigner::sign(const std::string msg,
// XROOT READ FILE
//==============================================================================
XrootC2FSReadFile::XrootC2FSReadFile(const std::string &url,
const CryptoPP::RSA::PrivateKey & xrootPrivateKey,
const std::string & pool) {
const CryptoPP::RSA::PrivateKey & xrootPrivateKey, uint16_t timeout,
const std::string & pool): XrootBaseReadFile(timeout) {
// Setup parent's members
m_readPosition = 0;
m_URL = url;
......@@ -363,12 +364,13 @@ XrootC2FSReadFile::XrootC2FSReadFile(const std::string &url,
m_signedURL = m_URL + opaqueBloc.str();
// ... and finally open the file
XrootClEx::throwOnError(m_xrootFile.Open(m_signedURL, OpenFlags::Read),
XrootClEx::throwOnError(m_xrootFile.Open(m_signedURL, OpenFlags::Read, XrdCl::Access::None, m_timeout),
std::string("In XrootC2FSReadFile::XrootC2FSReadFile failed XrdCl::File::Open() on ")
+m_URL+" opaqueBlock="+opaqueBloc.str());
}
XrootReadFile::XrootReadFile(const std::string &xrootUrl) {
XrootReadFile::XrootReadFile(const std::string &xrootUrl, uint16_t timeout):
XrootBaseReadFile(timeout) {
// Setup parent's variables
m_readPosition = 0;
m_URL = xrootUrl + "?eos.ruid=0&eos.rgid=0"; // TODO: the second part of this string has been added by Daniele
......@@ -378,13 +380,13 @@ XrootReadFile::XrootReadFile(const std::string &xrootUrl) {
// m_URL = xrootUrl;
// and simply open
using XrdCl::OpenFlags;
XrootClEx::throwOnError(m_xrootFile.Open(m_URL, OpenFlags::Read),
XrootClEx::throwOnError(m_xrootFile.Open(m_URL, OpenFlags::Read, XrdCl::Access::None, m_timeout),
std::string("In XrootReadFile::XrootReadFile failed XrdCl::File::Open() on ")+m_URL);
}
size_t XrootBaseReadFile::read(void *data, const size_t size) const {
uint32_t ret;
XrootClEx::throwOnError(m_xrootFile.Read(m_readPosition, size, data, ret),
XrootClEx::throwOnError(m_xrootFile.Read(m_readPosition, size, data, ret, m_timeout),
std::string("In XrootReadFile::read failed XrdCl::File::Read() on ")+m_URL);
m_readPosition += ret;
return ret;
......@@ -394,7 +396,7 @@ size_t XrootBaseReadFile::size() const {
const bool forceStat=true;
XrdCl::StatInfo *statInfo(NULL);
size_t ret;
XrootClEx::throwOnError(m_xrootFile.Stat(forceStat, statInfo),
XrootClEx::throwOnError(m_xrootFile.Stat(forceStat, statInfo, m_timeout),
std::string("In XrootReadFile::size failed XrdCl::File::Stat() on ")+m_URL);
ret= statInfo->GetSize();
delete statInfo;
......@@ -403,7 +405,7 @@ size_t XrootBaseReadFile::size() const {
XrootBaseReadFile::~XrootBaseReadFile() throw() {
try{
m_xrootFile.Close();
m_xrootFile.Close(m_timeout);
} catch (...) {}
}
......@@ -411,8 +413,9 @@ XrootBaseReadFile::~XrootBaseReadFile() throw() {
// XROOT WRITE FILE
//==============================================================================
XrootC2FSWriteFile::XrootC2FSWriteFile(const std::string &url,
const CryptoPP::RSA::PrivateKey & xrootPrivateKey,
const std::string & pool){
const CryptoPP::RSA::PrivateKey & xrootPrivateKey, uint16_t timeout,
const std::string & pool):
XrootBaseWriteFile(timeout) {
// Setup parent's members
m_writePosition = 0;
m_closeTried = false;
......@@ -463,24 +466,27 @@ XrootC2FSWriteFile::XrootC2FSWriteFile(const std::string &url,
m_signedURL = m_URL + opaqueBloc.str();
// ... and finally open the file for write (deleting any existing one in case)
XrootClEx::throwOnError(m_xrootFile.Open(m_signedURL, OpenFlags::Delete | OpenFlags::Write),
XrootClEx::throwOnError(m_xrootFile.Open(m_signedURL, OpenFlags::Delete | OpenFlags::Write,
XrdCl::Access::None, m_timeout),
std::string("In XrootC2FSWriteFile::XrootC2FSWriteFile failed XrdCl::File::Open() on ")
+m_URL);
}
XrootWriteFile::XrootWriteFile(const std::string& xrootUrl) {
XrootWriteFile::XrootWriteFile(const std::string& xrootUrl, uint16_t timeout):
XrootBaseWriteFile(timeout) {
// Setup parent's variables
m_writePosition = 0;
m_URL = xrootUrl;
// and simply open
using XrdCl::OpenFlags;
XrootClEx::throwOnError(m_xrootFile.Open(m_URL, OpenFlags::Delete | OpenFlags::Write),
XrootClEx::throwOnError(m_xrootFile.Open(m_URL, OpenFlags::Delete | OpenFlags::Write,
XrdCl::Access::None, m_timeout),
std::string("In XrootWriteFile::XrootWriteFile failed XrdCl::File::Open() on ")+m_URL);
}
void XrootBaseWriteFile::write(const void *data, const size_t size) {
XrootClEx::throwOnError(m_xrootFile.Write(m_writePosition, size, data),
XrootClEx::throwOnError(m_xrootFile.Write(m_writePosition, size, data, m_timeout),
std::string("In XrootWriteFile::write failed XrdCl::File::Write() on ")
+m_URL);
m_writePosition += size;
......@@ -490,20 +496,21 @@ void XrootBaseWriteFile::close() {
// Multiple close protection
if (m_closeTried) return;
m_closeTried=true;
XrootClEx::throwOnError(m_xrootFile.Close(),
XrootClEx::throwOnError(m_xrootFile.Close(m_timeout),
std::string("In XrootWriteFile::close failed XrdCl::File::Stat() on ")+m_URL);
}
XrootBaseWriteFile::~XrootBaseWriteFile() throw() {
if(!m_closeTried){
m_xrootFile.Close();
m_xrootFile.Close(m_timeout);
}
}
//==============================================================================
// EOS READ FILE
//==============================================================================
EosReadFile::EosReadFile(const std::string &eosUrl) {
EosReadFile::EosReadFile(const std::string &eosUrl, uint16_t timeout):
m_timeout(timeout) {
// Setup parent's variables
m_readPosition = 0;
std::stringstream ss;
......@@ -511,14 +518,14 @@ EosReadFile::EosReadFile(const std::string &eosUrl) {
m_URL = ss.str();
// and simply open
using XrdCl::OpenFlags;
XrootClEx::throwOnError(m_xrootFile.Open(m_URL, OpenFlags::Read),
std::string("In XrootReadFile::XrootReadFile failed XrdCl::File::Open() on ")+m_URL);
XrootClEx::throwOnError(m_xrootFile.Open(m_URL, OpenFlags::Read, XrdCl::Access::None, m_timeout),
std::string("In EosReadFile::EosReadFile failed XrdCl::File::Open() on ")+m_URL);
}
size_t EosReadFile::read(void *data, const size_t size) const {
uint32_t ret;
XrootClEx::throwOnError(m_xrootFile.Read(m_readPosition, size, data, ret),
std::string("In XrootReadFile::read failed XrdCl::File::Read() on ")+m_URL);
XrootClEx::throwOnError(m_xrootFile.Read(m_readPosition, size, data, ret, m_timeout),
std::string("In EosReadFile::read failed XrdCl::File::Read() on ")+m_URL);
m_readPosition += ret;
return ret;
}
......@@ -527,8 +534,8 @@ size_t EosReadFile::size() const {
const bool forceStat=true;
XrdCl::StatInfo *statInfo(NULL);
size_t ret;
XrootClEx::throwOnError(m_xrootFile.Stat(forceStat, statInfo),
std::string("In XrootReadFile::size failed XrdCl::File::Stat() on ")+m_URL);
XrootClEx::throwOnError(m_xrootFile.Stat(forceStat, statInfo, m_timeout),
std::string("In EosReadFile::size failed XrdCl::File::Stat() on ")+m_URL);
ret= statInfo->GetSize();
delete statInfo;
return ret;
......@@ -536,14 +543,15 @@ size_t EosReadFile::size() const {
EosReadFile::~EosReadFile() throw() {
try{
m_xrootFile.Close();
m_xrootFile.Close(m_timeout);
} catch (...) {}
}
//==============================================================================
// EOS WRITE FILE
//==============================================================================
EosWriteFile::EosWriteFile(const std::string& eosUrl) {
EosWriteFile::EosWriteFile(const std::string& eosUrl, uint16_t timeout):
m_timeout(timeout) {
// Setup parent's variables
m_writePosition = 0;
std::stringstream ss;
......@@ -551,13 +559,14 @@ EosWriteFile::EosWriteFile(const std::string& eosUrl) {
m_URL = ss.str();
// and simply open
using XrdCl::OpenFlags;
XrootClEx::throwOnError(m_xrootFile.Open(m_URL, OpenFlags::Delete | OpenFlags::Write),
XrootClEx::throwOnError(m_xrootFile.Open(m_URL, OpenFlags::Delete | OpenFlags::Write,
XrdCl::Access::None, m_timeout),
std::string("In XrootWriteFile::XrootWriteFile failed XrdCl::File::Open() on ")+m_URL);
}
void EosWriteFile::write(const void *data, const size_t size) {
XrootClEx::throwOnError(m_xrootFile.Write(m_writePosition, size, data),
XrootClEx::throwOnError(m_xrootFile.Write(m_writePosition, size, data, m_timeout),
std::string("In XrootWriteFile::write failed XrdCl::File::Write() on ")
+m_URL);
m_writePosition += size;
......@@ -567,13 +576,13 @@ void EosWriteFile::close() {
// Multiple close protection
if (m_closeTried) return;
m_closeTried=true;
XrootClEx::throwOnError(m_xrootFile.Close(),
XrootClEx::throwOnError(m_xrootFile.Close(m_timeout),
std::string("In XrootWriteFile::close failed XrdCl::File::Stat() on ")+m_URL);
}
EosWriteFile::~EosWriteFile() throw() {
if(!m_closeTried){
m_xrootFile.Close();
m_xrootFile.Close(m_timeout);
}
}
......
......@@ -54,7 +54,7 @@ namespace castor {
typedef castor::tape::utils::Regex Regex;
public:
DiskFileFactory(const std::string & remoteFileProtocol,
const std::string & xrootPrivateKey);
const std::string & xrootPrivateKey, uint16_t xrootTimeout);
ReadFile * createReadFile(const std::string & path);
WriteFile * createWriteFile(const std::string & path);
private:
......@@ -69,6 +69,7 @@ namespace castor {
std::string m_xrootPrivateKeyFile;
CryptoPP::RSA::PrivateKey m_xrootPrivateKey;
bool m_xrootPrivateKeyLoaded;
const uint16_t m_xrootTimeout;
static cta::threading::Mutex g_rfioOptionsLock;
public:
......
......@@ -76,6 +76,7 @@ namespace castor {
//==============================================================================
class XrootBaseReadFile: public ReadFile {
public:
XrootBaseReadFile(uint16_t timeout): m_timeout(timeout) {}
virtual size_t size() const;
virtual size_t read(void *data, const size_t size) const;
virtual ~XrootBaseReadFile() throw();
......@@ -85,18 +86,20 @@ namespace castor {
// There is no const-correctness with XrdCl...
mutable XrdCl::File m_xrootFile;
mutable uint64_t m_readPosition;
const uint16_t m_timeout;
typedef castor::tape::server::exception::XrootCl XrootClEx;
};
class XrootReadFile: public XrootBaseReadFile {
public:
XrootReadFile(const std::string &xrootUrl);
XrootReadFile(const std::string &xrootUrl, uint16_t timeout = 0);
};
class XrootC2FSReadFile: public XrootBaseReadFile {
public:
XrootC2FSReadFile(const std::string &xrootUrl,
const CryptoPP::RSA::PrivateKey & privateKey,
uint16_t timeout = 0,
const std::string & cephPool = "");
virtual ~XrootC2FSReadFile() throw () {}
private:
......@@ -105,6 +108,7 @@ namespace castor {
class XrootBaseWriteFile: public WriteFile {
public:
XrootBaseWriteFile(uint16_t timeout): m_timeout(timeout) {}
virtual void write(const void *data, const size_t size);
virtual void close();
virtual ~XrootBaseWriteFile() throw();
......@@ -113,19 +117,21 @@ namespace castor {
void setURL(const std::string & v) { m_URL = v; }
XrdCl::File m_xrootFile;
uint64_t m_writePosition;
const uint16_t m_timeout;
typedef castor::tape::server::exception::XrootCl XrootClEx;
bool m_closeTried;
};
class XrootWriteFile: public XrootBaseWriteFile {
public:
XrootWriteFile(const std::string &xrootUrl);
XrootWriteFile(const std::string &xrootUrl, uint16_t timeout = 0);
};
class XrootC2FSWriteFile: public XrootBaseWriteFile {
public:
XrootC2FSWriteFile(const std::string &xrootUrl,
const CryptoPP::RSA::PrivateKey & privateKey,
uint16_t timeout = 0,
const std::string & cephPool = "");
virtual ~XrootC2FSWriteFile() throw () {}
private:
......@@ -137,7 +143,7 @@ namespace castor {
//==============================================================================
class EosReadFile: public ReadFile {
public:
EosReadFile(const std::string &eosUrl);
EosReadFile(const std::string &eosUrl, uint16_t timeout = 0);
virtual size_t size() const;
virtual size_t read(void *data, const size_t size) const;
virtual ~EosReadFile() throw();
......@@ -147,12 +153,13 @@ namespace castor {
// There is no const-correctness with XrdCl...
mutable XrdCl::File m_xrootFile;
mutable uint64_t m_readPosition;
const uint16_t m_timeout;
typedef castor::tape::server::exception::XrootCl XrootClEx;
};
class EosWriteFile: public WriteFile {
public:
EosWriteFile(const std::string &eosUrl);
EosWriteFile(const std::string &eosUrl, uint16_t timeout = 0);
virtual void write(const void *data, const size_t size);
virtual void close();
virtual ~EosWriteFile() throw();
......@@ -161,6 +168,7 @@ namespace castor {
void setURL(const std::string & v) { m_URL = v; }
XrdCl::File m_xrootFile;
uint64_t m_writePosition;
const uint16_t m_timeout;
typedef castor::tape::server::exception::XrootCl XrootClEx;
bool m_closeTried;
};
......
......@@ -267,7 +267,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);
TempFile sourceFile;
sourceFile.randomFill(1000);
TempFile destinationFile(sourceFile.path()+"_dst");
......
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