Commit d855f2ca authored by Steven Murray's avatar Steven Murray
Browse files

The tapeserverd cleaner-session now uses MediaChangerFacade

parent 18c3e7c7
......@@ -27,12 +27,12 @@
// constructor
//------------------------------------------------------------------------------
castor::tape::tapeserver::daemon::CleanerSession::CleanerSession(
legacymsg::RmcProxy &rmc,
mediachanger::MediaChangerFacade &mc,
castor::log::Logger &log,
const utils::DriveConfig &driveConfig,
System::virtualWrapper &sysWrapper,
const std::string &vid):
m_rmc(rmc),
m_mc(mc),
m_log(log),
m_driveConfig(driveConfig),
m_sysWrapper(sysWrapper),
......@@ -106,7 +106,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
m_log(LOG_INFO, "Cleaner session could not unload the tape. Will still try to unmount it in case it is already unloaded.", params);
}
try {
m_rmc.dismountTape(vol1.getVSN(), m_driveConfig.librarySlot.str());
m_mc.dismountTape(vol1.getVSN(), m_driveConfig.librarySlot.str());
m_log(LOG_INFO, mediachanger::TAPE_LIBRARY_TYPE_MANUAL != m_driveConfig.librarySlot.getLibraryType() ?
"Cleaner session: unmounted tape":
"Cleaner session: tape NOT unmounted (manual mode)");
......
......@@ -23,9 +23,9 @@
#pragma once
#include "castor/legacymsg/RmcProxy.hpp"
#include "castor/log/LogContext.hpp"
#include "castor/log/Logger.hpp"
#include "castor/mediachanger/MediaChangerFacade.hpp"
#include "castor/tape/tapeserver/daemon/Session.hpp"
#include "castor/tape/tapeserver/drive/DriveInterface.hpp"
#include "castor/tape/tapeserver/file/Structures.hpp"
......@@ -47,7 +47,7 @@ namespace daemon {
/**
* Constructor
*
* @param rmc Proxy object representing the rmcd daemon.
* @param mc Object representing the media changer.
* @param log Object representing the API to the CASTOR logging system.
* @param driveConfig Configuration of the tape drive to be cleaned.
* @param sysWrapper Object representing the operating system.
......@@ -55,7 +55,7 @@ namespace daemon {
* else the empty string.
*/
CleanerSession(
legacymsg::RmcProxy &rmc,
mediachanger::MediaChangerFacade &mc,
castor::log::Logger &log,
const utils::DriveConfig &driveConfig,
System::virtualWrapper &sysWrapper,
......@@ -86,9 +86,9 @@ namespace daemon {
private:
/**
* The object representing the rmcd daemon.
* The object representing the media changer.
*/
legacymsg::RmcProxy &m_rmc;
mediachanger::MediaChangerFacade &m_mc;
/**
* The logging object
......
......@@ -469,13 +469,25 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
params.push_back(log::Param("rmcPort", rqst.rmcport()));
m_log(LOG_INFO, "Cleaner-session child-process started", params);
const int sizeOfIOThreadPoolForZMQ = 1;
messages::SmartZmqContext
zmqContext(instantiateZmqContext(sizeOfIOThreadPoolForZMQ));
messages::AcsProxyZmq acs(m_log,
acs::DEFAULT_ACS_SERVER_INTERNAL_LISTENING_PORT, zmqContext.get());
mediachanger::MmcProxyLog mmc(m_log);
// The network timeout of rmc communications should be several minutes due
// to the time it takes to mount and unmount tapes
const int rmcNetTimeout = 600; // Timeout in seconds
legacymsg::RmcProxyTcpIp rmc(m_log, rqst.rmcport(), rmcNetTimeout);
mediachanger::MediaChangerFacade mediaChangerFacade(acs, mmc, rmc);
castor::tape::System::realWrapper sWrapper;
CleanerSession cleanerSession(
rmc,
mediaChangerFacade,
m_log,
driveConfig,
sWrapper,
......
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