Commit 216bd16d authored by Cedric CAFFY's avatar Cedric CAFFY
Browse files

Changed the cta::eos and castor::tape::diskFile namespace into cta::disk namespace

parent 50bdb549
......@@ -342,7 +342,7 @@ public:
log::LogContext &logContext);
void reportArchiveJobsBatch(std::list<std::unique_ptr<ArchiveJob>> & archiveJobsBatch,
eos::DiskReporterFactory & reporterFactory, log::TimingList&, utils::Timer &, log::LogContext &);
cta::disk::DiskReporterFactory & reporterFactory, log::TimingList&, utils::Timer &, log::LogContext &);
/*============== Repack support ===========================================*/
// Promotion of requests
......@@ -378,7 +378,7 @@ public:
log::LogContext &logContext);
void reportRetrieveJobsBatch(std::list<std::unique_ptr<RetrieveJob>> & retrieveJobsBatch,
eos::DiskReporterFactory & reporterFactory, log::TimingList&, utils::Timer&, log::LogContext&);
disk::DiskReporterFactory & reporterFactory, log::TimingList&, utils::Timer&, log::LogContext&);
/*!
* Batch job factory
......
......@@ -492,7 +492,7 @@ TEST_P(SchedulerTest, archive_report_and_retrieve_new_file) {
// Emulate the the reporter process reporting successful transfer to tape to the disk system
auto jobsToReport = scheduler.getNextArchiveJobsToReportBatch(10, lc);
ASSERT_NE(0, jobsToReport.size());
eos::DiskReporterFactory factory;
disk::DiskReporterFactory factory;
log::TimingList timings;
utils::Timer t;
scheduler.reportArchiveJobsBatch(jobsToReport, factory, timings, t, lc);
......@@ -691,7 +691,7 @@ TEST_P(SchedulerTest, archive_and_retrieve_failure) {
// Emulate the the reporter process reporting successful transfer to tape to the disk system
auto jobsToReport = scheduler.getNextArchiveJobsToReportBatch(10, lc);
ASSERT_NE(0, jobsToReport.size());
eos::DiskReporterFactory factory;
disk::DiskReporterFactory factory;
log::TimingList timings;
utils::Timer t;
scheduler.reportArchiveJobsBatch(jobsToReport, factory, timings, t, lc);
......@@ -809,7 +809,7 @@ TEST_P(SchedulerTest, archive_and_retrieve_failure) {
// Emulate the the reporter process
auto jobsToReport = scheduler.getNextRetrieveJobsToReportBatch(10, lc);
ASSERT_EQ(1, jobsToReport.size());
eos::DiskReporterFactory factory;
disk::DiskReporterFactory factory;
log::TimingList timings;
utils::Timer t;
scheduler.reportRetrieveJobsBatch(jobsToReport, factory, timings, t, lc);
......@@ -941,7 +941,7 @@ TEST_P(SchedulerTest, archive_and_retrieve_report_failure) {
// Emulate the the reporter process reporting successful transfer to tape to the disk system
auto jobsToReport = scheduler.getNextArchiveJobsToReportBatch(10, lc);
ASSERT_NE(0, jobsToReport.size());
eos::DiskReporterFactory factory;
disk::DiskReporterFactory factory;
log::TimingList timings;
utils::Timer t;
scheduler.reportArchiveJobsBatch(jobsToReport, factory, timings, t, lc);
......
......@@ -46,7 +46,7 @@ m_nextTask(destination),m_archiveJob(archiveJob),
//------------------------------------------------------------------------------
// DiskReadTask::execute
//------------------------------------------------------------------------------
void DiskReadTask::execute(cta::log::LogContext& lc, diskFile::DiskFileFactory & fileFactory,
void DiskReadTask::execute(cta::log::LogContext& lc, cta::disk::DiskFileFactory & fileFactory,
MigrationWatchDog & watchdog, const int threadID) {
using cta::log::LogContext;
using cta::log::Param;
......@@ -67,7 +67,7 @@ void DiskReadTask::execute(cta::log::LogContext& lc, diskFile::DiskFileFactory
//so dont do the same mistake twice !
checkMigrationFailing();
currentErrorToCount = "Error_diskOpenForRead";
std::unique_ptr<tape::diskFile::ReadFile> sourceFile(
std::unique_ptr<cta::disk::ReadFile> sourceFile(
fileFactory.createReadFile(m_archiveJob->srcURL));
cta::log::ScopedParamContainer URLcontext(lc);
URLcontext.add("path", m_archiveJob->srcURL)
......
......@@ -48,7 +48,7 @@ public:
cta::ArchiveJob *archiveJob,size_t numberOfBlock,
cta::threading::AtomicFlag& errorFlag);
void execute(cta::log::LogContext& lc, diskFile::DiskFileFactory & fileFactory,
void execute(cta::log::LogContext& lc, cta::disk::DiskFileFactory & fileFactory,
MigrationWatchDog & watchdog, const int threadID);
/**
* Return the stats of the tasks. Should be call after execute
......
......@@ -48,7 +48,7 @@ namespace unitTests{
};
using namespace castor::tape::tapeserver::daemon;
using namespace castor::tape::diskFile;
using namespace cta::disk;
struct MockMigrationReportPacker : public MigrationReportPacker {
void reportCompletedJob(std::unique_ptr<cta::ArchiveJob> successfulArchiveJob, cta::log::LogContext & lc) override {}
......@@ -137,7 +137,7 @@ namespace unitTests{
FakeTapeWriteTask ftwt;
ftwt.pushDataBlock(new MemBlock(1,blockSize));
castor::tape::tapeserver::daemon::DiskReadTask drt(ftwt,&file,blockNeeded,flag);
castor::tape::file::RadosStriperPool striperPool;
cta::disk::RadosStriperPool striperPool;
DiskFileFactory fileFactory("", 0, striperPool);
castor::messages::TapeserverProxyDummy tspd;
......
......@@ -181,7 +181,7 @@ private:
* A disk file factory, that will create the proper type of file access class,
* depending on the received path
*/
diskFile::DiskFileFactory m_diskFileFactory;
cta::disk::DiskFileFactory m_diskFileFactory;
};
/** Container for the threads */
......@@ -204,7 +204,7 @@ private:
/**
* A pool of rados striper connections, to be shared by all threads
*/
castor::tape::file::RadosStriperPool m_striperPool;
cta::disk::RadosStriperPool m_striperPool;
/**
* Reference to the watchdog, for error reporting.
......
......@@ -42,7 +42,7 @@ m_retrieveJob(retrieveJob),m_memManager(mm){}
// DiskWriteTask::execute
//------------------------------------------------------------------------------
bool DiskWriteTask::execute(RecallReportPacker& reporter,cta::log::LogContext& lc,
diskFile::DiskFileFactory & fileFactory, RecallWatchDog & watchdog,
cta::disk::DiskFileFactory & fileFactory, RecallWatchDog & watchdog,
const int threadID) {
using cta::log::LogContext;
using cta::log::Param;
......@@ -64,7 +64,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,cta::log::LogContext&
currentErrorToCount = "";
// Placeholder for the disk file. We will open it only
// after getting a first correct memory block.
std::unique_ptr<tape::diskFile::WriteFile> writeFile;
std::unique_ptr<cta::disk::WriteFile> writeFile;
int blockId = 0;
unsigned long checksum = Payload::zeroAdler32();
......
......@@ -57,7 +57,7 @@ public:
* @return true if the file has been successfully written false otherwise.
*/
virtual bool execute(RecallReportPacker& reporter,cta::log::LogContext& lc,
diskFile::DiskFileFactory & fileFactory, RecallWatchDog & watchdog,
cta::disk::DiskFileFactory & fileFactory, RecallWatchDog & watchdog,
const int threadID);
/**
......
......@@ -65,7 +65,7 @@ namespace unitTests{
using namespace castor::tape::tapeserver::daemon;
using namespace castor::tape::tapeserver::client;
using namespace castor::tape::diskFile;
using namespace cta::disk;
struct MockRecallReportPacker : public RecallReportPacker {
void reportCompletedJob(std::unique_ptr<cta::RetrieveJob> successfulRetrieveJob) override {
cta::threading::MutexLocker ml(m_mutex);
......@@ -104,7 +104,7 @@ namespace unitTests{
TestingRetrieveMount trm(std::move(dbrm));
MockRecallReportPacker report(&trm,lc);
RecallMemoryManager mm(10,100,lc);
castor::tape::file::RadosStriperPool striperPool;
cta::disk::RadosStriperPool striperPool;
DiskFileFactory fileFactory("", 0, striperPool);
cta::MockRetrieveMount mrm;
......
......@@ -145,7 +145,7 @@ private:
* A disk file factory, that will create the proper type of file access class,
* depending on the received path
*/
diskFile::DiskFileFactory m_diskFileFactory;
cta::disk::DiskFileFactory m_diskFileFactory;
virtual void run();
};
......@@ -192,7 +192,7 @@ protected:
/**
* A pool of rados striper connections, to be shared by all threads
*/
castor::tape::file::RadosStriperPool m_striperPool;
cta::disk::RadosStriperPool m_striperPool;
private:
/**
......
......@@ -87,7 +87,7 @@ public:
* Reads all the buffer in one go from a diskFile::ReadFile object
* @param from reference to the diskFile::ReadFile
*/
size_t read(tape::diskFile::ReadFile& from){
size_t read(cta::disk::ReadFile& from){
m_size = from.read(m_data,m_totalCapacity);
return m_size;
}
......@@ -98,7 +98,7 @@ public:
* @param from reference to the tapeFile::ReadFile
* @return whether another tape block will fit in the memory block.
*/
bool append(tape::tapeFile::ReadFile & from){
bool append(castor::tape::tapeFile::ReadFile & from){
if (from.getBlockSize() > remainingFreeSpace()) {
std::stringstream err;
err << "Trying to read a tape file block with too little space left: BlockSize="
......@@ -120,7 +120,7 @@ public:
* Write the complete buffer to a diskFile::WriteFile
* @param to reference to the diskFile::WriteFile
*/
void write(tape::diskFile::WriteFile& to){
void write(cta::disk::WriteFile& to){
to.write(m_data,m_size);
}
......
......@@ -271,17 +271,17 @@ namespace unitTests {
const uint32_t block_size = 1024;
char data1[block_size];
char data2[block_size];
castor::tape::file::RadosStriperPool striperPool;
castor::tape::diskFile::DiskFileFactory fileFactory("", 0, striperPool);
cta::disk::RadosStriperPool striperPool;
cta::disk::DiskFileFactory fileFactory("", 0, striperPool);
TempFile sourceFile;
sourceFile.randomFill(1000);
TempFile destinationFile(sourceFile.path()+"_dst");
// host part of file location
std::string lh = "localhost:";
{
std::unique_ptr<castor::tape::diskFile::ReadFile> rf(
std::unique_ptr<cta::disk::ReadFile> rf(
fileFactory.createReadFile(lh + sourceFile.path()));
std::unique_ptr<castor::tape::diskFile::WriteFile> wf(
std::unique_ptr<cta::disk::WriteFile> wf(
fileFactory.createWriteFile(lh + destinationFile.path()));
size_t res=0;
do {
......@@ -290,9 +290,9 @@ namespace unitTests {
} while(res);
wf->close();
}
std::unique_ptr<castor::tape::diskFile::ReadFile> src(
std::unique_ptr<cta::disk::ReadFile> src(
fileFactory.createReadFile(sourceFile.path()));
std::unique_ptr<castor::tape::diskFile::ReadFile> dst(
std::unique_ptr<cta::disk::ReadFile> dst(
fileFactory.createReadFile(destinationFile.path()));
size_t res1=0;
size_t res2=0;
......@@ -305,24 +305,24 @@ namespace unitTests {
}
TEST(ctaDirectoryTests, directoryExist) {
castor::tape::diskFile::LocalDirectory dir("/tmp/");
cta::disk::LocalDirectory dir("/tmp/");
ASSERT_TRUE(dir.exist());
castor::tape::diskFile::LocalDirectory dirNotExist("/AZERTY/");
cta::disk::LocalDirectory dirNotExist("/AZERTY/");
ASSERT_FALSE(dirNotExist.exist());
}
TEST(ctaDirectoryTests, directoryCreate){
const char * dirTestPath = "/tmp/testDir";
::rmdir(dirTestPath);
castor::tape::diskFile::LocalDirectory dir(dirTestPath);
cta::disk::LocalDirectory dir(dirTestPath);
ASSERT_NO_THROW(dir.mkdir());
::rmdir(dirTestPath);
}
TEST(ctaDirectoryTests, directoryFailCreate){
const char * dirTestPath = "//WRONG/PATH";
castor::tape::diskFile::LocalDirectory dir(dirTestPath);
cta::disk::LocalDirectory dir(dirTestPath);
ASSERT_THROW(dir.mkdir(),cta::exception::Errnum);
}
......@@ -330,7 +330,7 @@ namespace unitTests {
std::string dirTestPath = "/tmp/directoryGetFilesNames";
std::string rmCommand = "rm -rf "+dirTestPath;
::system(rmCommand.c_str());
castor::tape::diskFile::LocalDirectory dir(dirTestPath);
cta::disk::LocalDirectory dir(dirTestPath);
ASSERT_NO_THROW(dir.mkdir());
char filePath[] = "/tmp/directoryGetFilesNames/fileXXXXXX";
int fd = ::mkstemp(filePath);
......
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