Commit 3e7f0561 authored by Eric Cano's avatar Eric Cano
Browse files

Implemented cta::ArchiveJob::complete(), and added the members that should be...

Implemented cta::ArchiveJob::complete(), and added the members that should be set to have the necessary
information available at complete() time.
Updated the calls in the archive_and_retrieve_new_file unit test.
parent 51b7a1c7
...@@ -70,6 +70,10 @@ void cta::objectstore::Tape::removeIfEmpty() { ...@@ -70,6 +70,10 @@ void cta::objectstore::Tape::removeIfEmpty() {
} }
remove(); remove();
} }
void cta::objectstore::Tape::setStoredData(uint64_t bytes) {
checkPayloadWritable();
m_payload.set_bytesstored(bytes);
}
void cta::objectstore::Tape::addStoredData(uint64_t bytes) { void cta::objectstore::Tape::addStoredData(uint64_t bytes) {
checkPayloadWritable(); checkPayloadWritable();
...@@ -81,6 +85,16 @@ uint64_t cta::objectstore::Tape::getStoredData() { ...@@ -81,6 +85,16 @@ uint64_t cta::objectstore::Tape::getStoredData() {
return m_payload.bytesstored(); return m_payload.bytesstored();
} }
void cta::objectstore::Tape::setLastFseq(uint64_t lastFseq) {
checkPayloadWritable();
m_payload.set_lastfseq(lastFseq);
}
uint64_t cta::objectstore::Tape::getLastFseq() {
checkPayloadReadable();
return m_payload.lastfseq();
}
std::string cta::objectstore::Tape::getVid() { std::string cta::objectstore::Tape::getVid() {
checkPayloadReadable(); checkPayloadReadable();
return m_payload.vid(); return m_payload.vid();
...@@ -218,3 +232,11 @@ void cta::objectstore::Tape::releaseBusy() { ...@@ -218,3 +232,11 @@ void cta::objectstore::Tape::releaseBusy() {
} }
...@@ -78,6 +78,8 @@ public: ...@@ -78,6 +78,8 @@ public:
std::string getVid(); std::string getVid();
void setStoredData(uint64_t bytes); void setStoredData(uint64_t bytes);
void addStoredData(uint64_t bytes); void addStoredData(uint64_t bytes);
void setLastFseq(uint64_t lastFseq);
uint64_t getLastFseq();
}; };
}} }}
\ No newline at end of file
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
*/ */
#include "scheduler/ArchiveJob.hpp" #include "scheduler/ArchiveJob.hpp"
#include <limits>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// destructor // destructor
...@@ -27,20 +28,36 @@ cta::ArchiveJob::~ArchiveJob() throw() { ...@@ -27,20 +28,36 @@ cta::ArchiveJob::~ArchiveJob() throw() {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// constructor // constructor
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
cta::ArchiveJob::ArchiveJob(/*ArchiveMount &mount,*/ cta::ArchiveJob::ArchiveJob(ArchiveMount &mount,
NameServer & ns,
const ArchiveFile &archiveFile, const ArchiveFile &archiveFile,
const RemotePathAndStatus &remotePathAndStatus, const RemotePathAndStatus &remotePathAndStatus,
const TapeFileLocation &tapeFileLocation): const NameServerTapeFile &nsTapeFile):
/*mount(mount),*/ m_mount(mount), m_ns(ns),
archiveFile(archiveFile), archiveFile(archiveFile),
remotePathAndStatus(remotePathAndStatus), remotePathAndStatus(remotePathAndStatus),
tapeFileLocation(tapeFileLocation) {} nameServerTapeFile(nsTapeFile) {}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// complete // complete
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void cta::ArchiveJob::complete() { void cta::ArchiveJob::complete() {
throw NotImplemented(""); // First check that the block Id for the file has been set.
if (nameServerTapeFile.tapeFileLocation.blockId ==
std::numeric_limits<decltype(nameServerTapeFile.tapeFileLocation.blockId)>::max())
throw BlockIdNotSet("In cta::ArchiveJob::complete(): Block ID not set");
// Also check the checksum has been set
if (nameServerTapeFile.checksum.getType() == Checksum::CHECKSUMTYPE_NONE)
throw ChecksumNotSet("In cta::ArchiveJob::complete(): checksum not set");
// We are good to go to record the data in the persistent storage.
// First make the file safe on tape.
m_dbJob->bumpUpTapeFileCount(nameServerTapeFile.tapeFileLocation.vid,
nameServerTapeFile.tapeFileLocation.fSeq);
// Now record the data in the archiveNS
m_ns.addTapeFile(SecurityIdentity(UserIdentity(std::numeric_limits<uint32_t>::max(),
std::numeric_limits<uint32_t>::max()), ""), archiveFile.path, nameServerTapeFile);
// We can now record the success for the job in the database
m_dbJob->succeed();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include "common/archiveNS/ArchiveFile.hpp" #include "common/archiveNS/ArchiveFile.hpp"
#include "common/exception/Exception.hpp" #include "common/exception/Exception.hpp"
#include "common/remoteFS/RemotePathAndStatus.hpp" #include "common/remoteFS/RemotePathAndStatus.hpp"
#include "scheduler/SchedulerDatabase.hpp"
#include "nameserver/NameServer.hpp"
#include <stdint.h> #include <stdint.h>
#include <string> #include <string>
...@@ -47,7 +49,7 @@ protected: ...@@ -47,7 +49,7 @@ protected:
/** /**
* Empty constructor. TODO: to be removed in the future when we put in the reference to the owning mount; * Empty constructor. TODO: to be removed in the future when we put in the reference to the owning mount;
*/ */
ArchiveJob() {} //ArchiveJob(): m_mount(*((ArchiveMount*)NULL)), m_ns(*((NameServer*)NULL)){}
/** /**
* Constructor. * Constructor.
...@@ -57,18 +59,22 @@ protected: ...@@ -57,18 +59,22 @@ protected:
* @param remotePathAndStatus location and properties of the remote file * @param remotePathAndStatus location and properties of the remote file
* @param tapeFileLocation the location within the tape * @param tapeFileLocation the location within the tape
*/ */
ArchiveJob(/*ArchiveMount &mount,*/ ArchiveJob(
ArchiveMount &mount,
NameServer & ns,
const ArchiveFile &archiveFile, const ArchiveFile &archiveFile,
const RemotePathAndStatus &remotePathAndStatus, const RemotePathAndStatus &remotePathAndStatus,
const TapeFileLocation &tapeFileLocation); const NameServerTapeFile &nameServerTapeFile);
public: public:
/** /**
* Destructor. * Destructor.
*/ */
virtual ~ArchiveJob() throw() = 0; virtual ~ArchiveJob() throw();
CTA_GENERATE_EXCEPTION_CLASS(BlockIdNotSet);
CTA_GENERATE_EXCEPTION_CLASS(ChecksumNotSet);
/** /**
* Indicates that the job was successful and updates the backend store * Indicates that the job was successful and updates the backend store
* *
...@@ -92,15 +98,22 @@ public: ...@@ -92,15 +98,22 @@ public:
* of the tape). * of the tape).
*/ */
virtual void retry(); virtual void retry();
public:
CTA_GENERATE_EXCEPTION_CLASS(NotImplemented); private:
std::unique_ptr<cta::SchedulerDatabase::ArchiveJob> m_dbJob;
/** /**
* The mount that generated this job * The mount that generated this job
*/ */
//ArchiveMount &mount; ArchiveMount &m_mount;
/**
* Reference to the name server
*/
NameServer &m_ns;
public:
CTA_GENERATE_EXCEPTION_CLASS(NotImplemented);
/** /**
* The NS archive file information * The NS archive file information
...@@ -111,11 +124,11 @@ public: ...@@ -111,11 +124,11 @@ public:
* The remote file information * The remote file information
*/ */
RemotePathAndStatus remotePathAndStatus; RemotePathAndStatus remotePathAndStatus;
/** /**
* The location of the tape file * The file archive result for the NS
*/ */
TapeFileLocation tapeFileLocation; NameServerTapeFile nameServerTapeFile;
}; // class ArchiveJob }; // class ArchiveJob
......
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// constructor // constructor
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
cta::ArchiveMount::ArchiveMount() { cta::ArchiveMount::ArchiveMount(NameServer & ns): m_ns(ns) {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// constructor // constructor
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
cta::ArchiveMount::ArchiveMount( cta::ArchiveMount::ArchiveMount(NameServer & ns,
std::unique_ptr<SchedulerDatabase::ArchiveMount> dbMount) { std::unique_ptr<SchedulerDatabase::ArchiveMount> dbMount): m_ns(ns) {
m_dbMount.reset( m_dbMount.reset(
dynamic_cast<SchedulerDatabase::ArchiveMount*>(dbMount.release())); dynamic_cast<SchedulerDatabase::ArchiveMount*>(dbMount.release()));
if(!m_dbMount.get()) { if(!m_dbMount.get()) {
...@@ -83,7 +83,15 @@ std::string cta::ArchiveMount::getMountTransactionId() const throw(){ ...@@ -83,7 +83,15 @@ std::string cta::ArchiveMount::getMountTransactionId() const throw(){
// getNextJob // getNextJob
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::unique_ptr<cta::ArchiveJob> cta::ArchiveMount::getNextJob() { std::unique_ptr<cta::ArchiveJob> cta::ArchiveMount::getNextJob() {
throw NotImplemented(std::string(__FUNCTION__) + ": Not implemented"); // try and get a new job from the DB side
std::unique_ptr<cta::SchedulerDatabase::ArchiveJob> dbJob(m_dbMount->getNextJob().release());
if (!dbJob.get())
return std::unique_ptr<cta::ArchiveJob>(NULL);
// We have something to migrate: prepare the response
std::unique_ptr<cta::ArchiveJob> ret(new ArchiveJob(*this, m_ns,
dbJob->archiveFile, dbJob->remoteFile, dbJob->nameServerTapeFile));
ret->m_dbJob.reset(dbJob.release());
return ret;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
#include "common/exception/Exception.hpp" #include "common/exception/Exception.hpp"
#include "scheduler/ArchiveJob.hpp" #include "scheduler/ArchiveJob.hpp"
#include "scheduler/ArchiveMount.hpp"
#include "scheduler/SchedulerDatabase.hpp" #include "scheduler/SchedulerDatabase.hpp"
#include "scheduler/TapeMount.hpp" #include "scheduler/TapeMount.hpp"
#include <memory> #include <memory>
namespace cta { namespace cta {
class NameServer;
/** /**
* The class driving a retrieve mount. * The class driving a retrieve mount.
...@@ -40,14 +40,14 @@ namespace cta { ...@@ -40,14 +40,14 @@ namespace cta {
/** /**
* Constructor. * Constructor.
*/ */
ArchiveMount(); ArchiveMount(NameServer & ns);
/** /**
* Constructor. * Constructor.
* *
* @param dbMount The database representation of this mount. * @param dbMount The database representation of this mount.
*/ */
ArchiveMount(std::unique_ptr<cta::SchedulerDatabase::ArchiveMount> dbMount); ArchiveMount(NameServer & ns, std::unique_ptr<cta::SchedulerDatabase::ArchiveMount> dbMount);
public: public:
...@@ -125,6 +125,11 @@ namespace cta { ...@@ -125,6 +125,11 @@ namespace cta {
* The database representation of this mount. * The database representation of this mount.
*/ */
std::unique_ptr<cta::SchedulerDatabase::ArchiveMount> m_dbMount; std::unique_ptr<cta::SchedulerDatabase::ArchiveMount> m_dbMount;
/**
* A reference to the name server.
*/
NameServer & m_ns;
}; // class ArchiveMount }; // class ArchiveMount
......
...@@ -1090,6 +1090,7 @@ std::unique_ptr<SchedulerDatabase::ArchiveMount> ...@@ -1090,6 +1090,7 @@ std::unique_ptr<SchedulerDatabase::ArchiveMount>
am.mountInfo.vid = vid; am.mountInfo.vid = vid;
am.mountInfo.drive = driveName; am.mountInfo.drive = driveName;
am.mountInfo.tapePool = tapePool; am.mountInfo.tapePool = tapePool;
am.m_nextFseq = std::numeric_limits<decltype(am.m_nextFseq)>::max();
objectstore::RootEntry re(m_objectStore); objectstore::RootEntry re(m_objectStore);
objectstore::ScopedSharedLock rel(re); objectstore::ScopedSharedLock rel(re);
re.fetch(); re.fetch();
...@@ -1142,8 +1143,11 @@ std::unique_ptr<SchedulerDatabase::ArchiveMount> ...@@ -1142,8 +1143,11 @@ std::unique_ptr<SchedulerDatabase::ArchiveMount>
m_agent.addToOwnership(t.getAddressIfSet()); m_agent.addToOwnership(t.getAddressIfSet());
m_agent.commit(); m_agent.commit();
} }
am.m_nextFseq = t.getLastFseq() + 1;
am.mountInfo.vid = t.getVid();
t.setBusy(driveName, objectstore::Tape::MountType::Archive, hostName, startTime, t.setBusy(driveName, objectstore::Tape::MountType::Archive, hostName, startTime,
m_agent.getAddressIfSet()); m_agent.getAddressIfSet());
t.commit();
} }
// Fill up the mount info // Fill up the mount info
privateRet->mountInfo.drive = driveName; privateRet->mountInfo.drive = driveName;
...@@ -1258,6 +1262,11 @@ auto OStoreDB::ArchiveMount::getNextJob() -> std::unique_ptr<SchedulerDatabase:: ...@@ -1258,6 +1262,11 @@ auto OStoreDB::ArchiveMount::getNextJob() -> std::unique_ptr<SchedulerDatabase::
tp.commit(); tp.commit();
privateRet->archiveFile.path = privateRet->m_atfr.getArchiveFile(); privateRet->archiveFile.path = privateRet->m_atfr.getArchiveFile();
privateRet->remoteFile = privateRet->m_atfr.getRemoteFile(); privateRet->remoteFile = privateRet->m_atfr.getRemoteFile();
privateRet->nameServerTapeFile.tapeFileLocation.fSeq = m_nextFseq++;
privateRet->nameServerTapeFile.tapeFileLocation.copyNb = privateRet->m_copyNb;
privateRet->nameServerTapeFile.tapeFileLocation.vid = mountInfo.vid;
privateRet->nameServerTapeFile.tapeFileLocation.blockId =
std::numeric_limits<decltype(privateRet->nameServerTapeFile.tapeFileLocation.blockId)>::max();
privateRet->m_jobOwned = true; privateRet->m_jobOwned = true;
privateRet->m_mountId = mountInfo.mountId; privateRet->m_mountId = mountInfo.mountId;
privateRet->m_tapePool = mountInfo.tapePool; privateRet->m_tapePool = mountInfo.tapePool;
...@@ -1312,8 +1321,12 @@ void OStoreDB::ArchiveJob::fail() { ...@@ -1312,8 +1321,12 @@ void OStoreDB::ArchiveJob::fail() {
} }
} }
throw NoSuchTapePool("In OStoreDB::ArchiveJob::fail(): could not find the tape pool"); throw NoSuchTapePool("In OStoreDB::ArchiveJob::fail(): could not find the tape pool");
}
void OStoreDB::ArchiveJob::bumpUpTapeFileCount(const std::string& vid, uint64_t newFileCount) {
} }
void OStoreDB::ArchiveJob::succeed() { void OStoreDB::ArchiveJob::succeed() {
// Lock the request and set the job as successful. // Lock the request and set the job as successful.
objectstore::ScopedExclusiveLock atfrl(m_atfr); objectstore::ScopedExclusiveLock atfrl(m_atfr);
......
...@@ -75,6 +75,7 @@ public: ...@@ -75,6 +75,7 @@ public:
ArchiveMount(objectstore::Backend &, objectstore::Agent &); ArchiveMount(objectstore::Backend &, objectstore::Agent &);
objectstore::Backend & m_objectStore; objectstore::Backend & m_objectStore;
objectstore::Agent & m_agent; objectstore::Agent & m_agent;
uint64_t m_nextFseq;
public: public:
virtual const MountInfo & getMountInfo(); virtual const MountInfo & getMountInfo();
virtual std::unique_ptr<ArchiveJob> getNextJob(); virtual std::unique_ptr<ArchiveJob> getNextJob();
...@@ -88,6 +89,7 @@ public: ...@@ -88,6 +89,7 @@ public:
CTA_GENERATE_EXCEPTION_CLASS(NoSuchJob); CTA_GENERATE_EXCEPTION_CLASS(NoSuchJob);
virtual void succeed(); virtual void succeed();
virtual void fail(); virtual void fail();
virtual void bumpUpTapeFileCount(const std::string& vid, uint64_t newFileCount);
virtual ~ArchiveJob(); virtual ~ArchiveJob();
private: private:
ArchiveJob(const std::string &, objectstore::Backend &, objectstore::Agent &); ArchiveJob(const std::string &, objectstore::Backend &, objectstore::Agent &);
......
...@@ -848,7 +848,7 @@ std::unique_ptr<cta::TapeMount> cta::Scheduler::getNextMount( ...@@ -848,7 +848,7 @@ std::unique_ptr<cta::TapeMount> cta::Scheduler::getNextMount(
t->status.availableToWrite()) { t->status.availableToWrite()) {
// We have our tape. Try to create the session. Prepare a return value // We have our tape. Try to create the session. Prepare a return value
// for it. // for it.
std::unique_ptr<ArchiveMount> internalRet(new ArchiveMount); std::unique_ptr<ArchiveMount> internalRet(new ArchiveMount(m_ns));
// Get the db side of the session // Get the db side of the session
try { try {
internalRet->m_dbMount.reset(mountInfo->createArchiveMount(t->vid, internalRet->m_dbMount.reset(mountInfo->createArchiveMount(t->vid,
......
...@@ -26,12 +26,14 @@ ...@@ -26,12 +26,14 @@
#include <vector> #include <vector>
#include <stdexcept> #include <stdexcept>
#include "common/archiveNS/ArchiveFile.hpp" #include "common/archiveNS/ArchiveFile.hpp"
#include "common/archiveNS/TapeFileLocation.hpp"
#include "common/admin/AdminUser.hpp" #include "common/admin/AdminUser.hpp"
#include "common/admin/AdminHost.hpp" #include "common/admin/AdminHost.hpp"
#include "common/archiveRoutes/ArchiveRoute.hpp" #include "common/archiveRoutes/ArchiveRoute.hpp"
#include "common/remoteFS/RemotePathAndStatus.hpp" #include "common/remoteFS/RemotePathAndStatus.hpp"
#include "scheduler/MountType.hpp" #include "scheduler/MountType.hpp"
#include "common/MountControl.hpp" #include "common/MountControl.hpp"
#include "nameserver/NameServerTapeFile.hpp"
namespace cta { namespace cta {
...@@ -176,8 +178,10 @@ public: ...@@ -176,8 +178,10 @@ public:
public: public:
cta::RemotePathAndStatus remoteFile; cta::RemotePathAndStatus remoteFile;
cta::ArchiveFile archiveFile; cta::ArchiveFile archiveFile;
cta::NameServerTapeFile nameServerTapeFile;
virtual void succeed() = 0; virtual void succeed() = 0;
virtual void fail() = 0; virtual void fail() = 0;
virtual void bumpUpTapeFileCount(const std::string & vid, uint64_t newFileCount) = 0;
virtual ~ArchiveJob() {} virtual ~ArchiveJob() {}
}; };
......
...@@ -2418,7 +2418,11 @@ TEST_P(SchedulerTest, archive_and_retrieve_new_file) { ...@@ -2418,7 +2418,11 @@ TEST_P(SchedulerTest, archive_and_retrieve_new_file) {
std::unique_ptr<cta::ArchiveJob> archiveJob; std::unique_ptr<cta::ArchiveJob> archiveJob;
ASSERT_NO_THROW(archiveJob.reset(archiveMount->getNextJob().release())); ASSERT_NO_THROW(archiveJob.reset(archiveMount->getNextJob().release()));
ASSERT_NE((cta::ArchiveJob*)NULL, archiveJob.get()); ASSERT_NE((cta::ArchiveJob*)NULL, archiveJob.get());
archiveJob->complete(); archiveJob->nameServerTapeFile.tapeFileLocation.blockId = 1;
archiveJob->nameServerTapeFile.copyNb = archiveJob->nameServerTapeFile.tapeFileLocation.copyNb;
cta::Checksum checksum(cta::Checksum::CHECKSUMTYPE_ADLER32, cta::ByteArray(0x12345687));
archiveJob->nameServerTapeFile.checksum = checksum;
ASSERT_NO_THROW(archiveJob->complete());
ASSERT_NO_THROW(archiveJob.reset(archiveMount->getNextJob().release())); ASSERT_NO_THROW(archiveJob.reset(archiveMount->getNextJob().release()));
ASSERT_EQ((cta::ArchiveJob*)NULL, archiveJob.get()); ASSERT_EQ((cta::ArchiveJob*)NULL, archiveJob.get());
ASSERT_NO_THROW(archiveMount->complete()); ASSERT_NO_THROW(archiveMount->complete());
......
...@@ -143,7 +143,9 @@ protected: ...@@ -143,7 +143,9 @@ protected:
class MockArchiveJob: public cta::ArchiveJob { class MockArchiveJob: public cta::ArchiveJob {
public: public:
MockArchiveJob() { MockArchiveJob(): cta::ArchiveJob(*((cta::ArchiveMount *)NULL),
*((cta::NameServer *)NULL), cta::ArchiveFile(),
cta::RemotePathAndStatus(), cta::NameServerTapeFile()) {
} }
~MockArchiveJob() throw() { ~MockArchiveJob() throw() {
...@@ -229,7 +231,7 @@ TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessio ...@@ -229,7 +231,7 @@ TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessio
std::unique_ptr<cta::RetrieveJob> ftr(new MockRetrieveJob()); std::unique_ptr<cta::RetrieveJob> ftr(new MockRetrieveJob());
std::unique_ptr<cta::ArchiveJob> ftm(new MockArchiveJob()); std::unique_ptr<cta::ArchiveJob> ftm(new MockArchiveJob());
ftr->tapeFileLocation.fSeq = fseq; ftr->tapeFileLocation.fSeq = fseq;
ftm->tapeFileLocation.fSeq = fseq; ftm->nameServerTapeFile.tapeFileLocation.fSeq = fseq;
ftr->archiveFile.fileId = 1000 + fseq; ftr->archiveFile.fileId = 1000 + fseq;
ftm->archiveFile.fileId = 1000 + fseq; ftm->archiveFile.fileId = 1000 + fseq;
castor::tape::tapeFile::WriteFile wf(&ws, *ftm, archiveFileSize); castor::tape::tapeFile::WriteFile wf(&ws, *ftm, archiveFileSize);
...@@ -374,7 +376,7 @@ TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessio ...@@ -374,7 +376,7 @@ TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessio
std::unique_ptr<cta::RetrieveJob> ftr(new MockRetrieveJob()); std::unique_ptr<cta::RetrieveJob> ftr(new MockRetrieveJob());
std::unique_ptr<cta::ArchiveJob> ftm_temp(new MockArchiveJob()); std::unique_ptr<cta::ArchiveJob> ftm_temp(new MockArchiveJob());
ftr->tapeFileLocation.fSeq = fseq; ftr->tapeFileLocation.fSeq = fseq;
ftm_temp->tapeFileLocation.fSeq = fseq; ftm_temp->nameServerTapeFile.tapeFileLocation.fSeq = fseq;
ftr->archiveFile.fileId = 1000 + fseq; ftr->archiveFile.fileId = 1000 + fseq;
ftm_temp->archiveFile.fileId = 1000 + fseq; ftm_temp->archiveFile.fileId = 1000 + fseq;
castor::tape::tapeFile::WriteFile wf(&ws, *ftm_temp, archiveFileSize); castor::tape::tapeFile::WriteFile wf(&ws, *ftm_temp, archiveFileSize);
...@@ -570,7 +572,7 @@ TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessio ...@@ -570,7 +572,7 @@ TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessio
std::unique_ptr<cta::RetrieveJob> ftr(new MockRetrieveJob()); std::unique_ptr<cta::RetrieveJob> ftr(new MockRetrieveJob());
std::unique_ptr<cta::ArchiveJob> ftm_temp(new MockArchiveJob()); std::unique_ptr<cta::ArchiveJob> ftm_temp(new MockArchiveJob());
ftr->tapeFileLocation.fSeq = fseq; ftr->tapeFileLocation.fSeq = fseq;
ftm_temp->tapeFileLocation.fSeq = fseq; ftm_temp->nameServerTapeFile.tapeFileLocation.fSeq = fseq;
ftr->archiveFile.fileId = 1000 + fseq; ftr->archiveFile.fileId = 1000 + fseq;
ftm_temp->archiveFile.fileId = 1000 + fseq; ftm_temp->archiveFile.fileId = 1000 + fseq;
castor::tape::tapeFile::WriteFile wf(&ws, *ftm_temp, archiveFileSize); castor::tape::tapeFile::WriteFile wf(&ws, *ftm_temp, archiveFileSize);
......
...@@ -38,13 +38,16 @@ namespace unitTests{ ...@@ -38,13 +38,16 @@ namespace unitTests{
class TestingArchiveMount: public cta::ArchiveMount { class TestingArchiveMount: public cta::ArchiveMount {
public: public:
TestingArchiveMount(std::unique_ptr<cta::SchedulerDatabase::ArchiveMount> dbrm): ArchiveMount(std::move(dbrm)) { TestingArchiveMount(std::unique_ptr<cta::SchedulerDatabase::ArchiveMount> dbrm):
ArchiveMount(*((cta::NameServer *)NULL),std::move(dbrm)) {
}