Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
18c3e7c7
Commit
18c3e7c7
authored
Oct 08, 2014
by
Steven Murray
Browse files
The tapeserverd label-session now uses MediaChangerFacade
parent
87d5a575
Changes
3
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/LabelSession.cpp
View file @
18c3e7c7
...
...
@@ -44,14 +44,14 @@
//------------------------------------------------------------------------------
castor
::
tape
::
tapeserver
::
daemon
::
LabelSession
::
LabelSession
(
messages
::
TapeserverProxy
&
tapeserver
,
legacymsg
::
RmcProxy
&
r
mc
,
mediachanger
::
MediaChangerFacade
&
mc
,
const
legacymsg
::
TapeLabelRqstMsgBody
&
clientRequest
,
castor
::
log
::
Logger
&
log
,
System
::
virtualWrapper
&
sysWrapper
,
const
utils
::
DriveConfig
&
driveConfig
,
const
bool
force
)
:
m_tapeserver
(
tapeserver
),
m_
r
mc
(
r
mc
),
m_mc
(
mc
),
m_request
(
clientRequest
),
m_log
(
log
),
m_sysWrapper
(
sysWrapper
),
...
...
@@ -82,9 +82,12 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
drive
->
unloadTape
();
m_log
(
LOG_INFO
,
"The tape has been successfully unloaded after labeling"
,
params
);
m_rmc
.
dismountTape
(
m_request
.
vid
,
m_driveConfig
.
librarySlot
.
str
());
m_log
(
LOG_INFO
,
"The tape has been successfully unmounted after labeling"
,
params
);
m_mc
.
dismountTape
(
m_request
.
vid
,
m_driveConfig
.
librarySlot
.
str
());
if
(
mediachanger
::
TAPE_LIBRARY_TYPE_MANUAL
!=
m_driveConfig
.
librarySlot
.
getLibraryType
())
{
m_log
(
LOG_INFO
,
"The tape has been successfully unmounted after labeling"
,
params
);
}
return
MARK_DRIVE_AS_UP
;
}
catch
(
castor
::
exception
::
Exception
&
ex
)
{
...
...
@@ -131,12 +134,15 @@ std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface>
//------------------------------------------------------------------------------
void
castor
::
tape
::
tapeserver
::
daemon
::
LabelSession
::
mountTape
()
{
try
{
m_rmc
.
mountTapeReadWrite
(
m_request
.
vid
,
m_driveConfig
.
librarySlot
.
str
());
const
log
::
Param
params
[]
=
{
log
::
Param
(
"vid"
,
m_request
.
vid
),
log
::
Param
(
"unitName"
,
m_request
.
drive
),
log
::
Param
(
"librarySlot"
,
m_driveConfig
.
librarySlot
.
str
())};
m_log
(
LOG_INFO
,
"Tape successfully mounted for labeling"
,
params
);
m_mc
.
mountTapeReadWrite
(
m_request
.
vid
,
m_driveConfig
.
librarySlot
.
str
());
if
(
mediachanger
::
TAPE_LIBRARY_TYPE_MANUAL
!=
m_driveConfig
.
librarySlot
.
getLibraryType
())
{
const
log
::
Param
params
[]
=
{
log
::
Param
(
"vid"
,
m_request
.
vid
),
log
::
Param
(
"unitName"
,
m_request
.
drive
),
log
::
Param
(
"librarySlot"
,
m_driveConfig
.
librarySlot
.
str
())};
m_log
(
LOG_INFO
,
"Tape successfully mounted for labeling"
,
params
);
}
}
catch
(
castor
::
exception
::
Exception
&
ne
)
{
castor
::
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
"Failed to mount tape for labeling: "
<<
...
...
castor/tape/tapeserver/daemon/LabelSession.hpp
View file @
18c3e7c7
...
...
@@ -24,9 +24,9 @@
#pragma once
#include
"castor/legacymsg/TapeLabelRqstMsgBody.hpp"
#include
"castor/legacymsg/RmcProxy.hpp"
#include
"castor/log/LogContext.hpp"
#include
"castor/log/Logger.hpp"
#include
"castor/mediachanger/MediaChangerFacade.hpp"
#include
"castor/messages/TapeserverProxy.hpp"
#include
"castor/tape/tapeserver/client/ClientProxy.hpp"
#include
"castor/tape/tapeserver/system/Wrapper.hpp"
...
...
@@ -53,7 +53,7 @@ public:
* Constructor
*
* @param tapeserver Proxy object representing the tapeserverd daemon.
* @param
r
mc
Proxy o
bject representing the
rmcd daemon
.
* @param mc
O
bject representing the
media changer
.
* @param clientRequest The request to label a tape received from the label
* tape command.
* @param log Object representing the API to the CASTOR logging system.
...
...
@@ -65,7 +65,7 @@ public:
*/
LabelSession
(
messages
::
TapeserverProxy
&
tapeserver
,
legacymsg
::
RmcProxy
&
r
mc
,
mediachanger
::
MediaChangerFacade
&
mc
,
const
legacymsg
::
TapeLabelRqstMsgBody
&
clientRequest
,
castor
::
log
::
Logger
&
log
,
System
::
virtualWrapper
&
sysWrapper
,
...
...
@@ -152,9 +152,9 @@ private:
messages
::
TapeserverProxy
&
m_tapeserver
;
/**
* The object representing the
rmcd daemon
.
* The object representing the
media changer
.
*/
legacymsg
::
RmcProxy
&
m_
r
mc
;
mediachanger
::
MediaChangerFacade
&
m_mc
;
/**
* The label request message body
...
...
castor/tape/tapeserver/daemon/ProcessForker.cpp
View file @
18c3e7c7
...
...
@@ -862,15 +862,23 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
messages
::
TapeserverProxyZmq
tapeserver
(
m_log
,
TAPESERVER_INTERNAL_LISTENING_PORT
,
zmqContext
.
get
());
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
);
legacymsg
::
NsProxy_TapeAlwaysEmpty
ns
;
castor
::
tape
::
System
::
realWrapper
sWrapper
;
LabelSession
labelsession
(
tapeserver
,
rmc
,
mediaChangerFacade
,
labelJob
,
m_log
,
sWrapper
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment