Commit d6577179 authored by Daniele Kruse's avatar Daniele Kruse
Browse files

Added support for the cleaner session in the drive catalogue

parent 70483454
......@@ -210,6 +210,38 @@ std::list<std::string> castor::tape::tapeserver::daemon::DriveCatalogue::
return unitNames;
}
//-----------------------------------------------------------------------------
// getUnitNamesWaitingForCleanerFork
//-----------------------------------------------------------------------------
std::list<std::string> castor::tape::tapeserver::daemon::DriveCatalogue::
getUnitNamesWaitingForCleanerFork() const {
std::list<std::string> unitNames;
for(DriveMap::const_iterator itor = m_drives.begin();
itor != m_drives.end(); itor++) {
const std::string &unitName = itor->first;
const DriveCatalogueEntry &drive = *(itor->second);
const utils::DriveConfig &driveConfig = drive.getConfig();
// Sanity check
if(unitName != driveConfig.unitName) {
// Should never get here
castor::exception::Exception ex;
ex.getMessage() << "Failed to get unit names of drives waiting for forking a cleaner session" <<
": unit name mismatch: unitName=" << unitName <<
" driveConfig.unitName=" << driveConfig.unitName;
throw ex;
}
if(DriveCatalogueEntry::SESSION_TYPE_CLEANER==drive.getSessionType() &&
DriveCatalogueSession::SESSION_STATE_WAITFORK == drive.getSessionState()) {
unitNames.push_back(itor->first);
}
}
return unitNames;
}
//-----------------------------------------------------------------------------
// findConstDrive
//-----------------------------------------------------------------------------
......
......@@ -120,7 +120,7 @@ public:
std::list<std::string> getUnitNames(const DriveCatalogueEntry::DriveState state) const;
/**
* Returns an unordered list of the unit names of the tape drives wait for
* Returns an unordered list of the unit names of the tape drives waiting for
* forking a transfer session.
*
* @return Unordered list of the unit names.
......@@ -128,12 +128,20 @@ public:
std::list<std::string> getUnitNamesWaitingForTransferFork() const;
/**
* Returns an unordered list of the unit names of the tape drives wait for
* Returns an unordered list of the unit names of the tape drives waiting for
* forking a label session.
*
* @return Unordered list of the unit names.
*/
std::list<std::string> getUnitNamesWaitingForLabelFork() const;
/**
* Returns an unordered list of the unit names of the tape drives waiting for
* forking a cleaner session.
*
* @return Unordered list of the unit names.
*/
std::list<std::string> getUnitNamesWaitingForCleanerFork() const;
private:
......
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