Commit caa2396d authored by Eric Cano's avatar Eric Cano
Browse files

Moved cta::DriveState and cta::DrveStatus classes into cta::common.

parent c8e948c5
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "scheduler/MountType.hpp" #include "scheduler/MountType.hpp"
namespace cta { namespace cta { namespace common {
enum DriveStatus { enum DriveStatus {
Down, Down,
...@@ -59,4 +59,4 @@ namespace cta { ...@@ -59,4 +59,4 @@ namespace cta {
std::string currentTapePool; std::string currentTapePool;
}; };
} }} //namespace cta::common
\ No newline at end of file \ No newline at end of file
...@@ -148,7 +148,8 @@ void cta::objectstore::DriveRegister::addDrive(const std::string & driveName, ...@@ -148,7 +148,8 @@ void cta::objectstore::DriveRegister::addDrive(const std::string & driveName,
} }
cta::objectstore::serializers::DriveStatus cta::objectstore::serializers::DriveStatus
cta::objectstore::DriveRegister::serializeDriveStatus(DriveStatus driveStatus) { cta::objectstore::DriveRegister::serializeDriveStatus(common::DriveStatus driveStatus) {
using common::DriveStatus;
switch (driveStatus) { switch (driveStatus) {
case DriveStatus::Down: case DriveStatus::Down:
return serializers::DriveStatus::Down; return serializers::DriveStatus::Down;
...@@ -173,9 +174,10 @@ cta::objectstore::serializers::DriveStatus ...@@ -173,9 +174,10 @@ cta::objectstore::serializers::DriveStatus
} }
} }
cta::DriveStatus cta::common::DriveStatus
cta::objectstore::DriveRegister::deserializeDriveStatus( cta::objectstore::DriveRegister::deserializeDriveStatus(
serializers::DriveStatus driveStatus) { serializers::DriveStatus driveStatus) {
using common::DriveStatus;
switch (driveStatus) { switch (driveStatus) {
case serializers::DriveStatus::Down: case serializers::DriveStatus::Down:
return DriveStatus::Down; return DriveStatus::Down;
...@@ -237,10 +239,11 @@ namespace { ...@@ -237,10 +239,11 @@ namespace {
} }
void cta::objectstore::DriveRegister::reportDriveStatus(const std::string& driveName, void cta::objectstore::DriveRegister::reportDriveStatus(const std::string& driveName,
const std::string& logicalLibary, DriveStatus status, time_t reportTime, const std::string& logicalLibary, common::DriveStatus status, time_t reportTime,
cta::MountType::Enum mountType, uint64_t mountSessionId, uint64_t byteTransfered, cta::MountType::Enum mountType, uint64_t mountSessionId, uint64_t byteTransfered,
uint64_t filesTransfered, double latestBandwidth, const std::string & vid, uint64_t filesTransfered, double latestBandwidth, const std::string & vid,
const std::string & tapepool) { const std::string & tapepool) {
using common::DriveStatus;
// Wrap all the parameters together for easier manipulation by sub-functions // Wrap all the parameters together for easier manipulation by sub-functions
ReportDriveStatusInputs inputs (driveName, logicalLibary); ReportDriveStatusInputs inputs (driveName, logicalLibary);
inputs.mountType = mountType; inputs.mountType = mountType;
...@@ -583,6 +586,7 @@ void cta::objectstore::DriveRegister::setDriveCleaningUp(ReportDriveStatusInputs ...@@ -583,6 +586,7 @@ void cta::objectstore::DriveRegister::setDriveCleaningUp(ReportDriveStatusInputs
void cta::objectstore::DriveRegister::checkReportDriveStatusInputs( void cta::objectstore::DriveRegister::checkReportDriveStatusInputs(
ReportDriveStatusInputs& inputs) { ReportDriveStatusInputs& inputs) {
using common::DriveStatus;
// Depending on the status, we might or might not expect statistics. // Depending on the status, we might or might not expect statistics.
std::set<int> statusesRequiringStats = { std::set<int> statusesRequiringStats = {
(int)DriveStatus::Transfering, (int)DriveStatus::Transfering,
...@@ -610,12 +614,12 @@ void cta::objectstore::DriveRegister::checkReportDriveStatusInputs( ...@@ -610,12 +614,12 @@ void cta::objectstore::DriveRegister::checkReportDriveStatusInputs(
} }
auto cta::objectstore::DriveRegister::dumpDrives() -> std::list<DriveState> { auto cta::objectstore::DriveRegister::dumpDrives() -> std::list<common::DriveState> {
checkPayloadReadable(); checkPayloadReadable();
auto & dl = m_payload.drives(); auto & dl = m_payload.drives();
std::list<DriveState> ret; std::list<common::DriveState> ret;
for (auto d=dl.begin(); d!=dl.end(); d++) { for (auto d=dl.begin(); d!=dl.end(); d++) {
ret.push_back(DriveState()); ret.push_back(common::DriveState());
auto & di = ret.back(); auto & di = ret.back();
di.name = d->drivename(); di.name = d->drivename();
di.logicalLibrary = d->logicallibrary(); di.logicalLibrary = d->logicallibrary();
......
...@@ -47,8 +47,8 @@ public: ...@@ -47,8 +47,8 @@ public:
private: private:
cta::MountType::Enum deserializeMountType(serializers::MountType); cta::MountType::Enum deserializeMountType(serializers::MountType);
serializers::MountType serializeMountType(cta::MountType::Enum); serializers::MountType serializeMountType(cta::MountType::Enum);
DriveStatus deserializeDriveStatus(serializers::DriveStatus); common::DriveStatus deserializeDriveStatus(serializers::DriveStatus);
serializers::DriveStatus serializeDriveStatus(DriveStatus); serializers::DriveStatus serializeDriveStatus(common::DriveStatus);
public: public:
CTA_GENERATE_EXCEPTION_CLASS(MissingStatistics); CTA_GENERATE_EXCEPTION_CLASS(MissingStatistics);
CTA_GENERATE_EXCEPTION_CLASS(MissingTapeInfo); CTA_GENERATE_EXCEPTION_CLASS(MissingTapeInfo);
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
* Report the status of the drive to the DB. * Report the status of the drive to the DB.
*/ */
void reportDriveStatus (const std::string & drive, const std::string & logicalLibary, void reportDriveStatus (const std::string & drive, const std::string & logicalLibary,
DriveStatus status, time_t reportTime, common::DriveStatus status, time_t reportTime,
cta::MountType::Enum mountType = cta::MountType::NONE, cta::MountType::Enum mountType = cta::MountType::NONE,
uint64_t mountSessionId = std::numeric_limits<uint64_t>::max(), uint64_t mountSessionId = std::numeric_limits<uint64_t>::max(),
uint64_t byteTransfered = std::numeric_limits<uint64_t>::max(), uint64_t byteTransfered = std::numeric_limits<uint64_t>::max(),
...@@ -73,7 +73,7 @@ private: ...@@ -73,7 +73,7 @@ private:
struct ReportDriveStatusInputs { struct ReportDriveStatusInputs {
const std::string & drive; const std::string & drive;
const std::string & logicalLibary; const std::string & logicalLibary;
DriveStatus status; common::DriveStatus status;
cta::MountType::Enum mountType; cta::MountType::Enum mountType;
time_t reportTime; time_t reportTime;
uint64_t mountSessionId; uint64_t mountSessionId;
...@@ -96,7 +96,7 @@ private: ...@@ -96,7 +96,7 @@ private:
void setDriveDrainingToDisk(ReportDriveStatusInputs & inputs, serializers::DriveState * drive); void setDriveDrainingToDisk(ReportDriveStatusInputs & inputs, serializers::DriveState * drive);
void setDriveCleaningUp(ReportDriveStatusInputs & inputs, serializers::DriveState * drive); void setDriveCleaningUp(ReportDriveStatusInputs & inputs, serializers::DriveState * drive);
public: public:
std::list<DriveState> dumpDrives(); std::list<common::DriveState> dumpDrives();
std::string dump(); std::string dump();
}; };
......
...@@ -121,6 +121,6 @@ cta::ArchiveMount::~ArchiveMount() throw() { ...@@ -121,6 +121,6 @@ cta::ArchiveMount::~ArchiveMount() throw() {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// setDriveStatus() // setDriveStatus()
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void cta::ArchiveMount::setDriveStatus(cta::DriveStatus status) { void cta::ArchiveMount::setDriveStatus(cta::common::DriveStatus status) {
m_dbMount->setDriveStatus(status, time(NULL)); m_dbMount->setDriveStatus(status, time(NULL));
} }
...@@ -88,7 +88,7 @@ namespace cta { ...@@ -88,7 +88,7 @@ namespace cta {
/** /**
* Report a drive status change * Report a drive status change
*/ */
virtual void setDriveStatus(cta::DriveStatus status); virtual void setDriveStatus(cta::common::DriveStatus status);
CTA_GENERATE_EXCEPTION_CLASS(SessionNotRunning); CTA_GENERATE_EXCEPTION_CLASS(SessionNotRunning);
/** /**
......
...@@ -150,13 +150,14 @@ std::unique_ptr<SchedulerDatabase::TapeMountDecisionInfo> ...@@ -150,13 +150,14 @@ std::unique_ptr<SchedulerDatabase::TapeMountDecisionInfo>
objectstore::ScopedSharedLock drl(dr); objectstore::ScopedSharedLock drl(dr);
dr.fetch(); dr.fetch();
auto dl = dr.dumpDrives(); auto dl = dr.dumpDrives();
using common::DriveStatus;
std::set<int> activeDriveStatuses = { std::set<int> activeDriveStatuses = {
(int)cta::DriveStatus::Starting, (int)DriveStatus::Starting,
(int)cta::DriveStatus::Mounting, (int)DriveStatus::Mounting,
(int)cta::DriveStatus::Transfering, (int)DriveStatus::Transfering,
(int)cta::DriveStatus::Unloading, (int)DriveStatus::Unloading,
(int)cta::DriveStatus::Unmounting, (int)DriveStatus::Unmounting,
(int)cta::DriveStatus::DrainingToDisk }; (int)DriveStatus::DrainingToDisk };
for (auto d=dl.begin(); d!= dl.end(); d++) { for (auto d=dl.begin(); d!= dl.end(); d++) {
if (activeDriveStatuses.count((int)d->status)) { if (activeDriveStatuses.count((int)d->status)) {
tmdi.existingMounts.push_back(ExistingMount()); tmdi.existingMounts.push_back(ExistingMount());
...@@ -1104,7 +1105,7 @@ void OStoreDB::deleteRetrieveRequest(const SecurityIdentity& requester, ...@@ -1104,7 +1105,7 @@ void OStoreDB::deleteRetrieveRequest(const SecurityIdentity& requester,
throw exception::Exception("Not Implemented"); throw exception::Exception("Not Implemented");
} }
std::list<cta::DriveState> OStoreDB::getDriveStates() const { std::list<cta::common::DriveState> OStoreDB::getDriveStates() const {
RootEntry re(m_objectStore); RootEntry re(m_objectStore);
ScopedSharedLock rel(re); ScopedSharedLock rel(re);
re.fetch(); re.fetch();
...@@ -1210,7 +1211,7 @@ std::unique_ptr<SchedulerDatabase::ArchiveMount> ...@@ -1210,7 +1211,7 @@ std::unique_ptr<SchedulerDatabase::ArchiveMount>
// goes to mount state. If the work to be done gets depleted in the mean time, // goes to mount state. If the work to be done gets depleted in the mean time,
// we will switch back to up. // we will switch back to up.
dr.reportDriveStatus(driveName, logicalLibrary, dr.reportDriveStatus(driveName, logicalLibrary,
cta::DriveStatus::Starting, startTime, cta::common::DriveStatus::Starting, startTime,
cta::MountType::ARCHIVE, privateRet->mountInfo.mountId, cta::MountType::ARCHIVE, privateRet->mountInfo.mountId,
0, 0, 0, vid, tapePool); 0, 0, 0, vid, tapePool);
dr.commit(); dr.commit();
...@@ -1314,7 +1315,7 @@ std::unique_ptr<SchedulerDatabase::RetrieveMount> ...@@ -1314,7 +1315,7 @@ std::unique_ptr<SchedulerDatabase::RetrieveMount>
// goes to mount state. If the work to be done gets depleted in the mean time, // goes to mount state. If the work to be done gets depleted in the mean time,
// we will switch back to up. // we will switch back to up.
dr.reportDriveStatus(driveName, logicalLibrary, dr.reportDriveStatus(driveName, logicalLibrary,
cta::DriveStatus::Starting, startTime, cta::common::DriveStatus::Starting, startTime,
cta::MountType::RETRIEVE, privateRet->mountInfo.mountId, cta::MountType::RETRIEVE, privateRet->mountInfo.mountId,
0, 0, 0, vid, tapePool); 0, 0, 0, vid, tapePool);
dr.commit(); dr.commit();
...@@ -1425,7 +1426,7 @@ void OStoreDB::ArchiveMount::complete(time_t completionTime) { ...@@ -1425,7 +1426,7 @@ void OStoreDB::ArchiveMount::complete(time_t completionTime) {
dr.fetch(); dr.fetch();
// Reset the drive state. // Reset the drive state.
dr.reportDriveStatus(mountInfo.drive, mountInfo.logicalLibrary, dr.reportDriveStatus(mountInfo.drive, mountInfo.logicalLibrary,
cta::DriveStatus::Up, completionTime, cta::common::DriveStatus::Up, completionTime,
cta::MountType::NONE, 0, cta::MountType::NONE, 0,
0, 0, 0, "", ""); 0, 0, 0, "", "");
dr.commit(); dr.commit();
...@@ -1550,7 +1551,7 @@ void OStoreDB::RetrieveMount::complete(time_t completionTime) { ...@@ -1550,7 +1551,7 @@ void OStoreDB::RetrieveMount::complete(time_t completionTime) {
dr.fetch(); dr.fetch();
// Reset the drive state. // Reset the drive state.
dr.reportDriveStatus(mountInfo.drive, mountInfo.logicalLibrary, dr.reportDriveStatus(mountInfo.drive, mountInfo.logicalLibrary,
cta::DriveStatus::Up, completionTime, cta::common::DriveStatus::Up, completionTime,
cta::MountType::NONE, 0, cta::MountType::NONE, 0,
0, 0, 0, "", ""); 0, 0, 0, "", "");
dr.commit(); dr.commit();
...@@ -1571,7 +1572,7 @@ void OStoreDB::RetrieveMount::complete(time_t completionTime) { ...@@ -1571,7 +1572,7 @@ void OStoreDB::RetrieveMount::complete(time_t completionTime) {
m_agent.commit(); m_agent.commit();
} }
void OStoreDB::RetrieveMount::setDriveStatus(cta::DriveStatus status, time_t completionTime) { void OStoreDB::RetrieveMount::setDriveStatus(cta::common::DriveStatus status, time_t completionTime) {
// We just report the drive status as instructed by the tape thread. // We just report the drive status as instructed by the tape thread.
// Get the drive register // Get the drive register
objectstore::RootEntry re(m_objectStore); objectstore::RootEntry re(m_objectStore);
...@@ -1588,7 +1589,7 @@ void OStoreDB::RetrieveMount::setDriveStatus(cta::DriveStatus status, time_t com ...@@ -1588,7 +1589,7 @@ void OStoreDB::RetrieveMount::setDriveStatus(cta::DriveStatus status, time_t com
dr.commit(); dr.commit();
} }
void OStoreDB::ArchiveMount::setDriveStatus(cta::DriveStatus status, time_t completionTime) { void OStoreDB::ArchiveMount::setDriveStatus(cta::common::DriveStatus status, time_t completionTime) {
// We just report the drive status as instructed by the tape thread. // We just report the drive status as instructed by the tape thread.
// Get the drive register // Get the drive register
objectstore::RootEntry re(m_objectStore); objectstore::RootEntry re(m_objectStore);
......
...@@ -85,7 +85,7 @@ public: ...@@ -85,7 +85,7 @@ public:
virtual const MountInfo & getMountInfo(); virtual const MountInfo & getMountInfo();
virtual std::unique_ptr<ArchiveJob> getNextJob(); virtual std::unique_ptr<ArchiveJob> getNextJob();
virtual void complete(time_t completionTime); virtual void complete(time_t completionTime);
virtual void setDriveStatus(cta::DriveStatus status, time_t completionTime); virtual void setDriveStatus(cta::common::DriveStatus status, time_t completionTime);
virtual void setTapeMaxFileCount(uint64_t maxFileId); virtual void setTapeMaxFileCount(uint64_t maxFileId);
}; };
...@@ -123,7 +123,7 @@ public: ...@@ -123,7 +123,7 @@ public:
virtual const MountInfo & getMountInfo(); virtual const MountInfo & getMountInfo();
virtual std::unique_ptr<RetrieveJob> getNextJob(); virtual std::unique_ptr<RetrieveJob> getNextJob();
virtual void complete(time_t completionTime); virtual void complete(time_t completionTime);
virtual void setDriveStatus(cta::DriveStatus status, time_t completionTime); virtual void setDriveStatus(cta::common::DriveStatus status, time_t completionTime);
}; };
/* === Retrieve Job handling ============================================== */ /* === Retrieve Job handling ============================================== */
...@@ -297,7 +297,7 @@ public: ...@@ -297,7 +297,7 @@ public:
const std::string& remoteFile); const std::string& remoteFile);
/* === Drive state handling ============================================== */ /* === Drive state handling ============================================== */
virtual std::list<cta::DriveState> getDriveStates() const; virtual std::list<cta::common::DriveState> getDriveStates() const;
private: private:
objectstore::Backend & m_objectStore; objectstore::Backend & m_objectStore;
objectstore::Agent * m_agent; objectstore::Agent * m_agent;
......
...@@ -199,7 +199,7 @@ public: ...@@ -199,7 +199,7 @@ public:
m_OStoreDB.queue(rqst); m_OStoreDB.queue(rqst);
} }
virtual std::list<cta::DriveState> getDriveStates() const { virtual std::list<cta::common::DriveState> getDriveStates() const {
return m_OStoreDB.getDriveStates(); return m_OStoreDB.getDriveStates();
} }
private: private:
......
...@@ -96,7 +96,7 @@ void cta::RetrieveMount::tapeComplete() { ...@@ -96,7 +96,7 @@ void cta::RetrieveMount::tapeComplete() {
} else { } else {
// This is a special case: we have to report the tape server is draining // This is a special case: we have to report the tape server is draining
// its memory to disk // its memory to disk
setDriveStatus(cta::DriveStatus::DrainingToDisk); setDriveStatus(cta::common::DriveStatus::DrainingToDisk);
} }
} }
...@@ -126,7 +126,7 @@ void cta::RetrieveMount::abort() { ...@@ -126,7 +126,7 @@ void cta::RetrieveMount::abort() {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// setDriveStatus() // setDriveStatus()
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void cta::RetrieveMount::setDriveStatus(cta::DriveStatus status) { void cta::RetrieveMount::setDriveStatus(cta::common::DriveStatus status) {
m_dbMount->setDriveStatus(status, time(NULL)); m_dbMount->setDriveStatus(status, time(NULL));
} }
......
...@@ -84,7 +84,7 @@ namespace cta { ...@@ -84,7 +84,7 @@ namespace cta {
/** /**
* Report a drive status change * Report a drive status change
*/ */
virtual void setDriveStatus(cta::DriveStatus status); virtual void setDriveStatus(cta::common::DriveStatus status);
/** /**
* Indicates that the disk thread of the mount was completed. This * Indicates that the disk thread of the mount was completed. This
......
...@@ -856,7 +856,7 @@ std::unique_ptr<cta::TapeMount> cta::Scheduler::getNextMount( ...@@ -856,7 +856,7 @@ std::unique_ptr<cta::TapeMount> cta::Scheduler::getNextMount(
Utils::getShortHostname(), Utils::getShortHostname(),
time(NULL)).release()); time(NULL)).release());
internalRet->m_sessionRunning = true; internalRet->m_sessionRunning = true;
internalRet->setDriveStatus(cta::DriveStatus::Starting); internalRet->setDriveStatus(cta::common::DriveStatus::Starting);
return std::unique_ptr<TapeMount> (internalRet.release()); return std::unique_ptr<TapeMount> (internalRet.release());
} catch (cta::exception::Exception & ex) { } catch (cta::exception::Exception & ex) {
continue; continue;
...@@ -881,7 +881,7 @@ std::unique_ptr<cta::TapeMount> cta::Scheduler::getNextMount( ...@@ -881,7 +881,7 @@ std::unique_ptr<cta::TapeMount> cta::Scheduler::getNextMount(
internalRet->m_sessionRunning = true; internalRet->m_sessionRunning = true;
internalRet->m_diskRunning = true; internalRet->m_diskRunning = true;
internalRet->m_tapeRunning = true; internalRet->m_tapeRunning = true;
internalRet->setDriveStatus(cta::DriveStatus::Starting); internalRet->setDriveStatus(cta::common::DriveStatus::Starting);
return std::unique_ptr<TapeMount> (internalRet.release()); return std::unique_ptr<TapeMount> (internalRet.release());
} catch (cta::exception::Exception & ex) { } catch (cta::exception::Exception & ex) {
std::string debug=ex.getMessageValue(); std::string debug=ex.getMessageValue();
...@@ -899,6 +899,6 @@ std::unique_ptr<cta::TapeMount> cta::Scheduler::getNextMount( ...@@ -899,6 +899,6 @@ std::unique_ptr<cta::TapeMount> cta::Scheduler::getNextMount(
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// getDriveStates // getDriveStates
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::list<cta::DriveState> cta::Scheduler::getDriveStates(const SecurityIdentity &requester) const { std::list<cta::common::DriveState> cta::Scheduler::getDriveStates(const SecurityIdentity &requester) const {
return m_db.getDriveStates(); return m_db.getDriveStates();
} }
...@@ -634,7 +634,7 @@ public: ...@@ -634,7 +634,7 @@ public:
* *
* @return The current list of registered drives. * @return The current list of registered drives.
*/ */
virtual std::list<cta::DriveState> getDriveStates(const SecurityIdentity &requester) const; virtual std::list<cta::common::DriveState> getDriveStates(const SecurityIdentity &requester) const;
private: private:
......
...@@ -146,7 +146,7 @@ public: ...@@ -146,7 +146,7 @@ public:
virtual const MountInfo & getMountInfo() = 0; virtual const MountInfo & getMountInfo() = 0;
virtual std::unique_ptr<ArchiveJob> getNextJob() = 0; virtual std::unique_ptr<ArchiveJob> getNextJob() = 0;
virtual void complete(time_t completionTime) = 0; virtual void complete(time_t completionTime) = 0;
virtual void setDriveStatus(DriveStatus status, time_t completionTime) = 0; virtual void setDriveStatus(common::DriveStatus status, time_t completionTime) = 0;
virtual ~ArchiveMount() {} virtual ~ArchiveMount() {}
uint32_t nbFilesCurrentlyOnTape; uint32_t nbFilesCurrentlyOnTape;
}; };
...@@ -220,7 +220,7 @@ public: ...@@ -220,7 +220,7 @@ public:
virtual const MountInfo & getMountInfo() = 0; virtual const MountInfo & getMountInfo() = 0;
virtual std::unique_ptr<RetrieveJob> getNextJob() = 0; virtual std::unique_ptr<RetrieveJob> getNextJob() = 0;
virtual void complete(time_t completionTime) = 0; virtual void complete(time_t completionTime) = 0;
virtual void setDriveStatus(DriveStatus status, time_t completionTime) = 0; virtual void setDriveStatus(common::DriveStatus status, time_t completionTime) = 0;
virtual ~RetrieveMount() {} virtual ~RetrieveMount() {}
uint32_t nbFilesCurrentlyOnTape; uint32_t nbFilesCurrentlyOnTape;
}; };
...@@ -603,7 +603,7 @@ public: ...@@ -603,7 +603,7 @@ public:
* *
* @return The current list of registered drives. * @return The current list of registered drives.
*/ */
virtual std::list<cta::DriveState> getDriveStates() const = 0; virtual std::list<cta::common::DriveState> getDriveStates() const = 0;
}; // class SchedulerDatabase }; // class SchedulerDatabase
......
...@@ -45,7 +45,7 @@ namespace unitTests{ ...@@ -45,7 +45,7 @@ namespace unitTests{
virtual const MountInfo & getMountInfo() { throw std::runtime_error("Not implemented"); } virtual const MountInfo & getMountInfo() { throw std::runtime_error("Not implemented"); }
virtual std::unique_ptr<cta::SchedulerDatabase::RetrieveJob> getNextJob() { throw std::runtime_error("Not implemented");} virtual std::unique_ptr<cta::SchedulerDatabase::RetrieveJob> getNextJob() { throw std::runtime_error("Not implemented");}
virtual void complete(time_t completionTime) { throw std::runtime_error("Not implemented"); } virtual void complete(time_t completionTime) { throw std::runtime_error("Not implemented"); }
virtual void setDriveStatus(cta::DriveStatus status, time_t completionTime) { throw std::runtime_error("Not implemented"); } virtual void setDriveStatus(cta::common::DriveStatus status, time_t completionTime) { throw std::runtime_error("Not implemented"); }
}; };
class TestingRetrieveMount: public cta::RetrieveMount { class TestingRetrieveMount: public cta::RetrieveMount {
......
...@@ -38,7 +38,7 @@ namespace unitTests{ ...@@ -38,7 +38,7 @@ namespace unitTests{
virtual const MountInfo & getMountInfo() { throw std::runtime_error("Not implemented"); } virtual const MountInfo & getMountInfo() { throw std::runtime_error("Not implemented"); }
virtual std::unique_ptr<cta::SchedulerDatabase::RetrieveJob> getNextJob() { throw std::runtime_error("Not implemented");} virtual std::unique_ptr<cta::SchedulerDatabase::RetrieveJob> getNextJob() { throw std::runtime_error("Not implemented");}
virtual void complete(time_t completionTime) { throw std::runtime_error("Not implemented"); } virtual void complete(time_t completionTime) { throw std::runtime_error("Not implemented"); }
virtual void setDriveStatus(cta::DriveStatus status, time_t completionTime) { throw std::runtime_error("Not implemented"); } virtual void setDriveStatus(cta::common::DriveStatus status, time_t completionTime) { throw std::runtime_error("Not implemented"); }
}; };
class TestingRetrieveMount: public cta::RetrieveMount { class TestingRetrieveMount: public cta::RetrieveMount {
......
...@@ -125,7 +125,7 @@ void MigrationReportPacker::ReportSuccessful::execute(MigrationReportPacker& rep ...@@ -125,7 +125,7 @@ void MigrationReportPacker::ReportSuccessful::execute(MigrationReportPacker& rep
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
//reportDriveStatus //reportDriveStatus
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void MigrationReportPacker::reportDriveStatus(cta::DriveStatus status) { void MigrationReportPacker::reportDriveStatus(cta::common::DriveStatus status) {
castor::server::MutexLocker ml(&m_producterProtection); castor::server::MutexLocker ml(&m_producterProtection);
m_fifo.push(new ReportDriveStatus(status)); m_fifo.push(new ReportDriveStatus(status));
} }
...@@ -135,7 +135,7 @@ void MigrationReportPacker::reportDriveStatus(cta::DriveStatus status) { ...@@ -135,7 +135,7 @@ void MigrationReportPacker::reportDriveStatus(cta::DriveStatus status) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void MigrationReportPacker::ReportDriveStatus::execute(MigrationReportPacker& parent){ void MigrationReportPacker::ReportDriveStatus::execute(MigrationReportPacker& parent){
parent.m_archiveMount->setDriveStatus(m_status); parent.m_archiveMount->setDriveStatus(m_status);
if(m_status==cta::DriveStatus::Unmounting) { if(m_status==cta::common::DriveStatus::Unmounting) {
parent.m_continue=false; parent.m_continue=false;
parent.m_archiveMount->complete(); parent.m_archiveMount->complete();
} }
......
...@@ -77,7 +77,7 @@ public: ...@@ -77,7 +77,7 @@ public:
* function is to be used by the tape thread when running. * function is to be used by the tape thread when running.
* @param state the new drive state. * @param state the new drive state.
*/ */
virtual void reportDriveStatus(cta::DriveStatus status); virtual void reportDriveStatus(cta::common::DriveStatus status);
/** /**
* Create into the MigrationReportPacker a report for the nominal end of session * Create into the MigrationReportPacker a report for the nominal end of session
...@@ -129,9 +129,9 @@ private: ...@@ -129,9 +129,9 @@ private:
}; };
class ReportDriveStatus : public Report { class ReportDriveStatus : public Report {
cta::DriveStatus m_status; cta::common::DriveStatus m_status;
public: public:
ReportDriveStatus(cta::DriveStatus status): m_status(