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
b095b1b3
Commit
b095b1b3
authored
Oct 09, 2014
by
Victor Kotlyar
Browse files
Renamed castor/acs to use read only instead of recall and read/write instead of migration.
parent
740fcb75
Changes
15
Hide whitespace changes
Inline
Side-by-side
castor/acs/AcsLibraryInteraction.hpp
View file @
b095b1b3
...
...
@@ -39,8 +39,8 @@ namespace castor {
namespace
acs
{
/**
* Abstract class implementing common code and data structures for mount
* for re
call, mount for migration
and dismount requests
* Abstract class implementing common code and data structures for mount
* for re
ad only access, mount for read/write access
and dismount requests
* that interact with ACS compatible tape libraries.
*/
class
AcsLibraryInteraction
{
...
...
castor/acs/AcsMessageHandler.cpp
View file @
b095b1b3
...
...
@@ -21,14 +21,14 @@
#include
"castor/messages/messages.hpp"
#include
"castor/messages/ReturnValue.pb.h"
#include
"castor/messages/AcsMountTape
ForRecall
.pb.h"
#include
"castor/messages/AcsMountTape
ForMigration
.pb.h"
#include
"castor/messages/AcsMountTape
ReadOnly
.pb.h"
#include
"castor/messages/AcsMountTape
ReadWrite
.pb.h"
#include
"castor/messages/AcsDismountTape.pb.h"
#include
"castor/acs/Constants.hpp"
#include
"castor/acs/AcsMessageHandler.hpp"
#include
"castor/acs/AcsDismountTape.hpp"
#include
"castor/acs/AcsMountTape
ForRecall
.hpp"
#include
"castor/acs/AcsMountTape
ForMigration
.hpp"
#include
"castor/acs/AcsMountTape
ReadOnly
.hpp"
#include
"castor/acs/AcsMountTape
ReadWrite
.hpp"
#include
"castor/acs/AcsDaemon.hpp"
#include
"castor/tape/utils/utils.hpp"
#include
"castor/acs/Acs.hpp"
...
...
@@ -179,11 +179,11 @@ castor::messages::Frame castor::acs::AcsMessageHandler::
m_log
(
LOG_DEBUG
,
"AcsMessageHandler dispatching message handler"
);
switch
(
rqst
.
header
.
msgtype
())
{
case
messages
::
MSG_TYPE_ACSMOUNTTAPE
FORRECALL
:
return
handleAcsMountTape
ForRecall
(
rqst
);
case
messages
::
MSG_TYPE_ACSMOUNTTAPE
READONLY
:
return
handleAcsMountTape
ReadOnly
(
rqst
);
case
messages
::
MSG_TYPE_ACSMOUNTTAPE
FORMIGRATION
:
return
handleAcsMountTape
ForMigration
(
rqst
);
case
messages
::
MSG_TYPE_ACSMOUNTTAPE
READWRITE
:
return
handleAcsMountTape
ReadWrite
(
rqst
);
case
messages
::
MSG_TYPE_ACSDISMOUNTTAPE
:
return
handleAcsDismountTape
(
rqst
);
...
...
@@ -199,14 +199,14 @@ castor::messages::Frame castor::acs::AcsMessageHandler::
}
//------------------------------------------------------------------------------
// handleAcsMountTape
ForRecall
// handleAcsMountTape
ReadOnly
//------------------------------------------------------------------------------
castor
::
messages
::
Frame
castor
::
acs
::
AcsMessageHandler
::
handleAcsMountTape
ForRecall
(
const
messages
::
Frame
&
rqst
)
{
m_log
(
LOG_DEBUG
,
"Handling AcsMountTape
ForRecall
message"
);
handleAcsMountTape
ReadOnly
(
const
messages
::
Frame
&
rqst
)
{
m_log
(
LOG_DEBUG
,
"Handling AcsMountTape
ReadOnly
message"
);
try
{
messages
::
AcsMountTape
ForRecall
rqstBody
;
messages
::
AcsMountTape
ReadOnly
rqstBody
;
rqst
.
parseBodyIntoProtocolBuffer
(
rqstBody
);
const
std
::
string
vid
=
rqstBody
.
vid
();
...
...
@@ -220,37 +220,38 @@ castor::messages::Frame castor::acs::AcsMessageHandler::
log
::
Param
(
"lsm"
,
lsm
),
log
::
Param
(
"panel"
,
panel
),
log
::
Param
(
"drive"
,
drive
)};
m_log
(
LOG_INFO
,
"AcsMountTape
ForRecall
message"
,
params
);
m_log
(
LOG_INFO
,
"AcsMountTape
ReadOnly
message"
,
params
);
castor
::
acs
::
AcsImpl
acsWrapper
;
castor
::
acs
::
AcsMountTape
ForRecall
acsMountTape
ForRecall
(
vid
,
acs
,
lsm
,
castor
::
acs
::
AcsMountTape
ReadOnly
acsMountTape
ReadOnly
(
vid
,
acs
,
lsm
,
panel
,
drive
,
acsWrapper
,
m_log
,
m_castorConf
);
try
{
acsMountTape
ForRecall
.
execute
();
m_log
(
LOG_INFO
,
"Tape successfully mounted for re
call
"
,
params
);
acsMountTape
ReadOnly
.
execute
();
m_log
(
LOG_INFO
,
"Tape successfully mounted for re
ad only access
"
,
params
);
}
catch
(
castor
::
exception
::
Exception
&
ne
)
{
m_log
(
LOG_ERR
,
"Tape mount for recall failed: "
+
ne
.
getMessage
().
str
(),
params
);
m_log
(
LOG_ERR
,
"Tape mount for read only access failed: "
+
ne
.
getMessage
().
str
(),
params
);
throw
;
}
const
messages
::
Frame
reply
=
createReturnValueFrame
(
0
);
return
reply
;
}
catch
(
castor
::
exception
::
Exception
&
ne
)
{
castor
::
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
"Failed to handle AcsMountTape
ForRecall
message: "
<<
ex
.
getMessage
()
<<
"Failed to handle AcsMountTape
ReadOnly
message: "
<<
ne
.
getMessage
().
str
();
throw
ex
;
}
}
//------------------------------------------------------------------------------
// handleAcsMountTape
ForMigration
// handleAcsMountTape
ReadWrite
//------------------------------------------------------------------------------
castor
::
messages
::
Frame
castor
::
acs
::
AcsMessageHandler
::
handleAcsMountTape
ForMigration
(
const
messages
::
Frame
&
rqst
)
{
m_log
(
LOG_DEBUG
,
"Handling AcsMountTape
ForMigration
message"
);
handleAcsMountTape
ReadWrite
(
const
messages
::
Frame
&
rqst
)
{
m_log
(
LOG_DEBUG
,
"Handling AcsMountTape
ReadWrite
message"
);
try
{
messages
::
AcsMountTape
ForMigration
rqstBody
;
messages
::
AcsMountTape
ReadWrite
rqstBody
;
rqst
.
parseBodyIntoProtocolBuffer
(
rqstBody
);
const
std
::
string
vid
=
rqstBody
.
vid
();
...
...
@@ -264,23 +265,24 @@ castor::messages::Frame castor::acs::AcsMessageHandler::
log
::
Param
(
"lsm"
,
lsm
),
log
::
Param
(
"panel"
,
panel
),
log
::
Param
(
"drive"
,
drive
)};
m_log
(
LOG_INFO
,
"AcsMountTape
ForMigration
message"
,
params
);
m_log
(
LOG_INFO
,
"AcsMountTape
ReadWrite
message"
,
params
);
castor
::
acs
::
AcsImpl
acsWrapper
;
castor
::
acs
::
AcsMountTape
ForMigration
acsMountTape
ForMigration
(
vid
,
acs
,
castor
::
acs
::
AcsMountTape
ReadWrite
acsMountTape
ReadWrite
(
vid
,
acs
,
lsm
,
panel
,
drive
,
acsWrapper
,
m_log
,
m_castorConf
);
try
{
acsMountTape
ForMigration
.
execute
();
m_log
(
LOG_INFO
,
"Tape successfully mounted for
migration
"
,
params
);
acsMountTape
ReadWrite
.
execute
();
m_log
(
LOG_INFO
,
"Tape successfully mounted for
read/write access
"
,
params
);
}
catch
(
castor
::
exception
::
Exception
&
ne
)
{
m_log
(
LOG_ERR
,
"Tape mount for migration failed: "
+
ne
.
getMessage
().
str
(),
params
);
m_log
(
LOG_ERR
,
"Tape mount for read/write access failed: "
+
ne
.
getMessage
().
str
(),
params
);
throw
;
}
const
messages
::
Frame
reply
=
createReturnValueFrame
(
0
);
return
reply
;
}
catch
(
castor
::
exception
::
Exception
&
ne
)
{
castor
::
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
"Failed to handle AcsMountTape
ForMigration
message: "
<<
ex
.
getMessage
()
<<
"Failed to handle AcsMountTape
ReadWrite
message: "
<<
ne
.
getMessage
().
str
();
throw
ex
;
}
...
...
castor/acs/AcsMessageHandler.hpp
View file @
b095b1b3
...
...
@@ -117,20 +117,20 @@ private:
messages
::
Frame
dispatchMsgHandler
(
const
messages
::
Frame
&
rqst
)
;
/**
* Handles the mount tape for re
call
.
* Handles the mount tape for re
ad only
.
*
* @param rqst The request.
* @return The reply.
*/
messages
::
Frame
handleAcsMountTape
ForRecall
(
const
messages
::
Frame
&
rqst
);
messages
::
Frame
handleAcsMountTape
ReadOnly
(
const
messages
::
Frame
&
rqst
);
/**
* Handles the mount tape for
migration request
.
* Handles the mount tape for
read/write
.
*
* @param rqst The request.
* @return The reply.
*/
messages
::
Frame
handleAcsMountTape
ForMigration
(
const
messages
::
Frame
&
rqst
);
messages
::
Frame
handleAcsMountTape
ReadWrite
(
const
messages
::
Frame
&
rqst
);
/**
* Handles the dismount tape request.
...
...
castor/acs/AcsMountTape
ForRecall
.cpp
→
castor/acs/AcsMountTape
ReadOnly
.cpp
View file @
b095b1b3
...
...
@@ -21,13 +21,13 @@
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include
"castor/acs/AcsMountTape
ForRecall
.hpp"
#include
"castor/acs/AcsMountTape
ReadOnly
.hpp"
#include
"castor/exception/MountFailed.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
castor
::
acs
::
AcsMountTape
ForRecall
::
AcsMountTape
ForRecall
(
castor
::
acs
::
AcsMountTape
ReadOnly
::
AcsMountTape
ReadOnly
(
const
std
::
string
&
vid
,
const
uint32_t
acs
,
const
uint32_t
lsm
,
...
...
@@ -47,35 +47,35 @@ castor::acs::AcsMountTapeForRecall::AcsMountTapeForRecall(
//------------------------------------------------------------------------------
// execute
//------------------------------------------------------------------------------
void
castor
::
acs
::
AcsMountTape
ForRecall
::
execute
()
const
{
syncMountTape
ForRecall
();
void
castor
::
acs
::
AcsMountTape
ReadOnly
::
execute
()
const
{
syncMountTape
ReadOnly
();
}
//------------------------------------------------------------------------------
// syncMountTape
ForRecall
// syncMountTape
ReadOnly
//------------------------------------------------------------------------------
void
castor
::
acs
::
AcsMountTape
ForRecall
::
syncMountTape
ForRecall
()
const
void
castor
::
acs
::
AcsMountTape
ReadOnly
::
syncMountTape
ReadOnly
()
const
{
const
SEQ_NO
requestSeqNumber
=
1
;
ALIGNED_BYTES
buf
[
MAX_MESSAGE_SIZE
/
sizeof
(
ALIGNED_BYTES
)];
try
{
sendMount
ForRecall
Request
(
requestSeqNumber
);
sendMount
TapeReadOnly
Request
(
requestSeqNumber
);
requestResponsesUntilFinal
(
requestSeqNumber
,
buf
,
m_castorConf
.
acsQueryLibraryInterval
,
m_castorConf
.
acsCommandTimeout
);
processMount
ForRecall
Response
(
buf
);
processMount
TapeReadOnly
Response
(
buf
);
}
catch
(
castor
::
exception
::
Exception
&
ex
)
{
castor
::
exception
::
MountFailed
mf
;
mf
.
getMessage
()
<<
"Failed to mount for re
call
volume "
<<
mf
.
getMessage
()
<<
"Failed to mount for re
ad only access
volume "
<<
m_volId
.
external_label
<<
": "
<<
ex
.
getMessage
().
str
();
throw
mf
;
}
}
//------------------------------------------------------------------------------
// sendMount
ForRecall
Request
// sendMount
TapeReadOnly
Request
//------------------------------------------------------------------------------
void
castor
::
acs
::
AcsMountTape
ForRecall
::
sendMount
ForRecall
Request
(
void
castor
::
acs
::
AcsMountTape
ReadOnly
::
sendMount
TapeReadOnly
Request
(
const
SEQ_NO
seqNumber
)
const
{
const
LOCKID
lockId
=
0
;
// No lock
const
BOOLEAN
bypass
=
FALSE
;
...
...
@@ -90,8 +90,8 @@ void castor::acs::AcsMountTapeForRecall::sendMountForRecallRequest(
if
(
STATUS_SUCCESS
!=
s
)
{
castor
::
exception
::
MountFailed
ex
;
ex
.
getMessage
()
<<
"Failed to send request to mount for re
call volume "
<<
m_volId
.
external_label
<<
" into drive "
<<
ex
.
getMessage
()
<<
"Failed to send request to mount for re
ad only access"
" volume "
<<
m_volId
.
external_label
<<
" into drive "
<<
m_acsWrapper
.
driveId2Str
(
m_driveId
)
<<
": readOnly="
<<
(
readOnly
?
"TRUE"
:
"FALSE"
)
<<
": "
<<
acs_status
(
s
);
throw
ex
;
...
...
@@ -99,17 +99,17 @@ void castor::acs::AcsMountTapeForRecall::sendMountForRecallRequest(
}
//------------------------------------------------------------------------------
// processMount
ForRecall
Response
// processMount
TapeReadOnly
Response
//------------------------------------------------------------------------------
void
castor
::
acs
::
AcsMountTape
ForRecall
::
processMount
ForRecall
Response
(
void
castor
::
acs
::
AcsMountTape
ReadOnly
::
processMount
TapeReadOnly
Response
(
ALIGNED_BYTES
(
&
buf
)[
MAX_MESSAGE_SIZE
/
sizeof
(
ALIGNED_BYTES
)])
const
{
const
ACS_MOUNT_RESPONSE
*
const
msg
=
(
ACS_MOUNT_RESPONSE
*
)
buf
;
if
(
STATUS_SUCCESS
!=
msg
->
mount_status
)
{
castor
::
exception
::
MountFailed
ex
;
ex
.
getMessage
()
<<
"Status of mount for re
call
response is not
success: "
<<
acs_status
(
msg
->
mount_status
);
ex
.
getMessage
()
<<
"Status of mount for re
ad only access
response is not
"
" success: "
<<
acs_status
(
msg
->
mount_status
);
throw
ex
;
}
}
...
...
@@ -117,5 +117,5 @@ void castor::acs::AcsMountTapeForRecall::processMountForRecallResponse(
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
castor
::
acs
::
AcsMountTape
ForRecall
::~
AcsMountTape
ForRecall
()
throw
()
{
castor
::
acs
::
AcsMountTape
ReadOnly
::~
AcsMountTape
ReadOnly
()
throw
()
{
}
castor/acs/AcsMountTape
ForRecall
.hpp
→
castor/acs/AcsMountTape
ReadOnly
.hpp
View file @
b095b1b3
...
...
@@ -32,16 +32,16 @@ namespace castor {
namespace
acs
{
/**
* Class responsible for mounting tapes for re
call
through ACS API .
* Class responsible for mounting tapes for re
ad only access
through ACS API .
*/
class
AcsMountTape
ForRecall
:
public
AcsLibraryInteraction
{
class
AcsMountTape
ReadOnly
:
public
AcsLibraryInteraction
{
public:
/**
* Constructor.
*/
AcsMountTape
ForRecall
(
AcsMountTape
ReadOnly
(
const
std
::
string
&
vid
,
const
uint32_t
acs
,
const
uint32_t
lsm
,
const
uint32_t
panel
,
const
uint32_t
drive
,
Acs
&
acsWrapper
,
log
::
Logger
&
log
,
...
...
@@ -50,7 +50,7 @@ public:
/**
* Destructor.
*/
~
AcsMountTape
ForRecall
()
throw
();
~
AcsMountTape
ReadOnly
()
throw
();
/**
* Execute mount request through ACS API.
...
...
@@ -66,14 +66,14 @@ protected:
* This method does not return until the mount has either succeeded, failed or
* the specified timeout has been reached.
*/
void
syncMountTape
ForRecall
()
const
;
void
syncMountTape
ReadOnly
()
const
;
/**
* Sends the mount request to ACSLS.
*
* @param seqNumber The sequence number to be used in the request.
*/
void
sendMount
ForRecall
Request
(
const
SEQ_NO
seqNumber
)
const
;
void
sendMount
TapeReadOnly
Request
(
const
SEQ_NO
seqNumber
)
const
;
/**
* Throws castor::exception::MountFailed if the mount was not
...
...
@@ -81,7 +81,7 @@ protected:
*
* @param buf The mount-response message.
*/
void
processMount
ForRecall
Response
(
void
processMount
TapeReadOnly
Response
(
ALIGNED_BYTES
(
&
buf
)[
MAX_MESSAGE_SIZE
/
sizeof
(
ALIGNED_BYTES
)])
const
;
/**
...
...
@@ -109,7 +109,7 @@ protected:
*/
const
AcsDaemon
::
CastorConf
&
m_castorConf
;
};
// class AcsMountTape
ForRecall
};
// class AcsMountTape
ReadOnly
}
// namespace acs
}
// namespace castor
castor/acs/AcsMountTape
ForMigration
.cpp
→
castor/acs/AcsMountTape
ReadWrite
.cpp
View file @
b095b1b3
...
...
@@ -21,13 +21,13 @@
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include
"castor/acs/AcsMountTape
ForMigration
.hpp"
#include
"castor/acs/AcsMountTape
ReadWrite
.hpp"
#include
"castor/exception/MountFailed.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
castor
::
acs
::
AcsMountTape
ForMigration
::
AcsMountTape
ForMigration
(
castor
::
acs
::
AcsMountTape
ReadWrite
::
AcsMountTape
ReadWrite
(
const
std
::
string
&
vid
,
const
uint32_t
acs
,
const
uint32_t
lsm
,
...
...
@@ -47,36 +47,36 @@ castor::acs::AcsMountTapeForMigration::AcsMountTapeForMigration(
//------------------------------------------------------------------------------
// execute
//------------------------------------------------------------------------------
void
castor
::
acs
::
AcsMountTape
ForMigration
::
execute
()
const
{
syncMountTape
ForMigration
();
void
castor
::
acs
::
AcsMountTape
ReadWrite
::
execute
()
const
{
syncMountTape
ReadWrite
();
}
//------------------------------------------------------------------------------
// syncMountTape
ForMigration
// syncMountTape
ReadWrite
//------------------------------------------------------------------------------
void
castor
::
acs
::
AcsMountTape
ForMigration
::
syncMountTape
ForMigration
()
const
void
castor
::
acs
::
AcsMountTape
ReadWrite
::
syncMountTape
ReadWrite
()
const
{
const
SEQ_NO
requestSeqNumber
=
1
;
ALIGNED_BYTES
buf
[
MAX_MESSAGE_SIZE
/
sizeof
(
ALIGNED_BYTES
)];
try
{
sendMount
ForMigration
Request
(
requestSeqNumber
);
sendMount
TapeReadWrite
Request
(
requestSeqNumber
);
requestResponsesUntilFinal
(
requestSeqNumber
,
buf
,
m_castorConf
.
acsQueryLibraryInterval
,
m_castorConf
.
acsCommandTimeout
);
processMount
ForMigration
Response
(
buf
);
processMount
TapeReadWrite
Response
(
buf
);
}
catch
(
castor
::
exception
::
Exception
&
ex
)
{
castor
::
exception
::
MountFailed
mf
;
mf
.
getMessage
()
<<
"Failed to mount for
migration
volume "
<<
mf
.
getMessage
()
<<
"Failed to mount for
read/write access
volume "
<<
m_volId
.
external_label
<<
": "
<<
ex
.
getMessage
().
str
();
throw
mf
;
}
}
//------------------------------------------------------------------------------
// sendMount
ForMigration
Request
// sendMount
TapeReadWrite
Request
//------------------------------------------------------------------------------
void
castor
::
acs
::
AcsMountTape
ForMigration
::
sendMountForMigration
Request
(
void
castor
::
acs
::
AcsMountTape
ReadWrite
::
sendMountTapeReadWrite
Request
(
const
SEQ_NO
seqNumber
)
const
{
const
LOCKID
lockId
=
0
;
// No lock
const
BOOLEAN
bypass
=
FALSE
;
...
...
@@ -91,27 +91,27 @@ void castor::acs::AcsMountTapeForMigration::sendMountForMigrationRequest(
if
(
STATUS_SUCCESS
!=
s
)
{
castor
::
exception
::
MountFailed
ex
;
ex
.
getMessage
()
<<
"Failed to send request to mount for
migration volume "
<<
m_volId
.
external_label
<<
" into drive "
<<
m_acsWrapper
.
driveId2Str
(
m_driveId
)
<<
": readOnly="
<<
(
readOnly
?
"TRUE"
:
"FALSE"
)
<<
": "
<<
acs_status
(
s
);
ex
.
getMessage
()
<<
"Failed to send request to mount for
read/write access"
" volume "
<<
m_volId
.
external_label
<<
" into drive "
<<
m_acsWrapper
.
driveId2Str
(
m_driveId
)
<<
": readOnly="
<<
(
readOnly
?
"TRUE"
:
"FALSE"
)
<<
": "
<<
acs_status
(
s
);
throw
ex
;
}
}
//------------------------------------------------------------------------------
// processMount
ForMigration
Response
// processMount
TapeReadWrite
Response
//------------------------------------------------------------------------------
void
castor
::
acs
::
AcsMountTape
ForMigration
::
processMount
ForMigration
Response
(
void
castor
::
acs
::
AcsMountTape
ReadWrite
::
processMount
TapeReadWrite
Response
(
ALIGNED_BYTES
(
&
buf
)[
MAX_MESSAGE_SIZE
/
sizeof
(
ALIGNED_BYTES
)])
const
{
const
ACS_MOUNT_RESPONSE
*
const
msg
=
(
ACS_MOUNT_RESPONSE
*
)
buf
;
if
(
STATUS_SUCCESS
!=
msg
->
mount_status
)
{
castor
::
exception
::
MountFailed
ex
;
ex
.
getMessage
()
<<
"Status of mount for
migration response is not su
ccess
:
"
<<
acs_status
(
msg
->
mount_status
);
ex
.
getMessage
()
<<
"Status of mount for
read/write a
ccess"
" response is not success: "
<<
acs_status
(
msg
->
mount_status
);
throw
ex
;
}
}
...
...
@@ -119,5 +119,5 @@ void castor::acs::AcsMountTapeForMigration::processMountForMigrationResponse(
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
castor
::
acs
::
AcsMountTape
ForMigration
::~
AcsMountTape
ForMigration
()
throw
()
{
castor
::
acs
::
AcsMountTape
ReadWrite
::~
AcsMountTape
ReadWrite
()
throw
()
{
}
castor/acs/AcsMountTape
ForMigration
.hpp
→
castor/acs/AcsMountTape
ReadWrite
.hpp
View file @
b095b1b3
...
...
@@ -32,16 +32,16 @@ namespace castor {
namespace
acs
{
/**
* Class responsible for mounting tapes for
migration
through ACS API .
* Class responsible for mounting tapes for
read/write access
through ACS API .
*/
class
AcsMountTape
ForMigration
:
public
AcsLibraryInteraction
{
class
AcsMountTape
ReadWrite
:
public
AcsLibraryInteraction
{
public:
/**
* Constructor.
*/
AcsMountTape
ForMigration
(
AcsMountTape
ReadWrite
(
const
std
::
string
&
vid
,
const
uint32_t
acs
,
const
uint32_t
lsm
,
const
uint32_t
panel
,
const
uint32_t
drive
,
Acs
&
acsWrapper
,
log
::
Logger
&
log
,
...
...
@@ -50,7 +50,7 @@ public:
/**
* Destructor.
*/
~
AcsMountTape
ForMigration
()
throw
();
~
AcsMountTape
ReadWrite
()
throw
();
/**
* Execute mount request through ACS API.
...
...
@@ -66,14 +66,14 @@ protected:
* This method does not return until the mount has either succeeded, failed or
* the specified timeout has been reached.
*/
void
syncMountTape
ForMigration
()
const
;
void
syncMountTape
ReadWrite
()
const
;
/**
* Sends the mount request to ACSLS.
*
* @param seqNumber The sequence number to be used in the request.
*/
void
sendMount
ForMigration
Request
(
const
SEQ_NO
seqNumber
)
const
;
void
sendMount
TapeReadWrite
Request
(
const
SEQ_NO
seqNumber
)
const
;
/**
* Throws castor::exception::MountFailed if the mount was not
...
...
@@ -81,7 +81,7 @@ protected:
*
* @param buf The mount-response message.
*/
void
processMount
ForMigration
Response
(
void
processMount
TapeReadWrite
Response
(
ALIGNED_BYTES
(
&
buf
)[
MAX_MESSAGE_SIZE
/
sizeof
(
ALIGNED_BYTES
)])
const
;
/**
...
...
@@ -109,7 +109,7 @@ protected:
*/
const
AcsDaemon
::
CastorConf
&
m_castorConf
;
};
// class AcsMountTape
ForMigration
};
// class AcsMountTape
ReadWrite
}
// namespace acs
}
// namespace castor
castor/acs/CMakeLists.txt
View file @
b095b1b3
...
...
@@ -39,8 +39,8 @@ if (STK_API_LIB AND STK_UTL_LIB AND STK_IPC_LIB AND STK_CL_LIB)
AcsDaemon.cpp
AcsMessageHandler.cpp
AcsDismountTape.cpp
AcsMountTape
ForRecall
.cpp
AcsMountTape
ForMigration
.cpp
AcsMountTape
ReadOnly
.cpp
AcsMountTape
ReadWrite
.cpp
AcsLibraryInteraction.cpp
Acs.cpp
AcsImpl.cpp
)
...
...
castor/messages/AcsMountTape
ForRecall
.proto
→
castor/messages/AcsMountTape
ReadOnly
.proto
View file @
b095b1b3
...
...
@@ -17,7 +17,7 @@
// @author Castor Dev team, castor-dev@cern.ch
package
castor
.
messages
;
message
AcsMountTape
ForRecall
{
message
AcsMountTape
ReadOnly
{
required
string
vid
=
1
;
required
uint32
acs
=
2
;
required
uint32
lsm
=
3
;
...
...
castor/messages/AcsMountTape
ForMigration
.proto
→
castor/messages/AcsMountTape
ReadWrite
.proto
View file @
b095b1b3
...
...
@@ -17,7 +17,7 @@
// @author Castor Dev team, castor-dev@cern.ch
package
castor
.
messages
;
message
AcsMountTape
ForMigration
{
message
AcsMountTape
ReadWrite
{
required
string
vid
=
1
;
required
uint32
acs
=
2
;
required
uint32
lsm
=
3
;
...
...
castor/messages/AcsProxyZmq.cpp
View file @
b095b1b3
...
...
@@ -19,8 +19,8 @@
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include
"castor/messages/AcsMountTape
ForRecall
.pb.h"
#include
"castor/messages/AcsMountTape
ForMigration
.pb.h"
#include
"castor/messages/AcsMountTape
ReadOnly
.pb.h"
#include
"castor/messages/AcsMountTape
ReadWrite
.pb.h"
#include
"castor/messages/AcsDismountTape.pb.h"
#include
"castor/messages/ReturnValue.pb.h"
#include
"castor/messages/AcsProxyZmq.hpp"
...
...
@@ -47,7 +47,7 @@ void castor::messages::AcsProxyZmq::mountTapeReadOnly(const std::string &vid,
server
::
MutexLocker
lock
(
&
m_mutex
);
try
{
const
Frame
rqst
=
createAcsMountTape
ForRecall
Frame
(
vid
,
librarySlot
);
const
Frame
rqst
=
createAcsMountTape
ReadOnly
Frame
(
vid
,
librarySlot
);
sendFrame
(
m_serverSocket
,
rqst
);
ReturnValue
reply
;
...
...
@@ -62,26 +62,26 @@ void castor::messages::AcsProxyZmq::mountTapeReadOnly(const std::string &vid,
}
catch
(
castor
::
exception
::
Exception
&
ne
)
{
castor
::
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
"Failed to request CASTOR ACS daemon to mount tape for re
call: "
<<
librarySlot
.
str
()
<<
": "
<<
ne
.
getMessage
().
str
();
"Failed to request CASTOR ACS daemon to mount tape for re
ad only access: "
<<
librarySlot
.
str
()
<<
": "
<<
ne
.
getMessage
().
str
();
throw
ex
;
}
}
//------------------------------------------------------------------------------
// createAcsMountTape
ForRecall
Frame
// createAcsMountTape
ReadnOnly
Frame
//------------------------------------------------------------------------------
castor
::
messages
::
Frame
castor
::
messages
::
AcsProxyZmq
::
createAcsMountTape
ForRecall
Frame
(
const
std
::
string
&
vid
,
createAcsMountTape
ReadOnly
Frame
(
const
std
::
string
&
vid
,
const
mediachanger
::
AcsLibrarySlot
&
librarySlot
)
{
try
{
Frame
frame
;
frame
.
header
=
messages
::
protoTapePreFillHeader
();
frame
.
header
.
set_msgtype
(
messages
::
MSG_TYPE_ACSMOUNTTAPE
FORRECALL
);
frame
.
header
.
set_msgtype
(
messages
::
MSG_TYPE_ACSMOUNTTAPE
READONLY
);
frame
.
header
.
set_bodysignature
(
"PIPO"
);
AcsMountTape
ForRecall
body
;
AcsMountTape
ReadOnly
body
;
body
.
set_vid
(
vid
);
body
.
set_acs
(
librarySlot
.
getAcs
());
body
.
set_lsm
(
librarySlot
.
getLsm
());
...
...
@@ -93,7 +93,7 @@ castor::messages::Frame castor::messages::AcsProxyZmq::
}
catch
(
castor
::
exception
::
Exception
&
ne
)
{
castor
::
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
"Failed to create AcsMountTape
ForRecall
frame: "
<<
ex
.
getMessage
()
<<
"Failed to create AcsMountTape
ReadOnly
frame: "
<<
ne
.
getMessage
().
str
();
throw
ex
;
}
...
...
@@ -107,7 +107,7 @@ void castor::messages::AcsProxyZmq::mountTapeReadWrite(const std::string &vid,
server
::
MutexLocker
lock
(
&
m_mutex
);
try
{
const
Frame
rqst
=
createAcsMountTape
ForMigration
Frame
(
vid
,
librarySlot
);
const
Frame
rqst
=
createAcsMountTape
ReadWrite
Frame
(
vid
,
librarySlot
);
sendFrame
(
m_serverSocket
,
rqst
);
ReturnValue
reply
;
...
...
@@ -122,26 +122,26 @@ void castor::messages::AcsProxyZmq::mountTapeReadWrite(const std::string &vid,
}
catch
(
castor
::
exception
::
Exception
&
ne
)
{
castor
::
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
"Failed to request CASTOR ACS daemon to mount tape for
migration:
"
<<
librarySlot
.
str
()
<<
": "
<<
ne
.
getMessage
().
str
();
"Failed to request CASTOR ACS daemon to mount tape for
read/write
"
"access: "
<<
librarySlot
.
str
()
<<
": "
<<
ne
.
getMessage
().
str
();