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
1879f4a0
Commit
1879f4a0
authored
Aug 07, 2015
by
Daniele Kruse
Browse files
Changed volume mode into mount type, filling in volInfo with the tape mount object
parent
b78cfd78
Changes
14
Hide whitespace changes
Inline
Side-by-side
scheduler/ArchiveMount.cpp
View file @
1879f4a0
...
...
@@ -45,6 +45,12 @@ std::string cta::ArchiveMount::getVid() const throw() {
return
"UNKNOWN_VID_FOR_ARCHIVE_MOUNT"
;
}
//------------------------------------------------------------------------------
// getDensity
//------------------------------------------------------------------------------
std
::
string
cta
::
ArchiveMount
::
getDensity
()
const
throw
()
{
return
"UNKNOWN_DENSITY_FOR_ARCHIVE_MOUNT"
;
}
//------------------------------------------------------------------------------
// complete
//------------------------------------------------------------------------------
...
...
scheduler/ArchiveMount.hpp
View file @
1879f4a0
...
...
@@ -62,6 +62,13 @@ namespace cta {
* @return The volume identifier of the tape to be mounted.
*/
virtual
std
::
string
getVid
()
const
throw
();
/**
* Returns the density of the tape to be mounted.
*
* @return The density of the tape to be mounted.
*/
virtual
std
::
string
getDensity
()
const
throw
();
/**
* Indicates that the mount was successful.
...
...
scheduler/RetrieveMount.cpp
View file @
1879f4a0
...
...
@@ -45,6 +45,13 @@ std::string cta::RetrieveMount::getVid() const throw() {
return
"UNKNOWN_VID_FOR_RETRIEVE_MOUNT"
;
}
//------------------------------------------------------------------------------
// getDensity
//------------------------------------------------------------------------------
std
::
string
cta
::
RetrieveMount
::
getDensity
()
const
throw
()
{
return
"UNKNOWN_DENSITY_FOR_RETRIEVE_MOUNT"
;
}
//------------------------------------------------------------------------------
// complete
//------------------------------------------------------------------------------
...
...
scheduler/RetrieveMount.hpp
View file @
1879f4a0
...
...
@@ -62,6 +62,13 @@ namespace cta {
* @return The volume identifier of the tape to be mounted.
*/
virtual
std
::
string
getVid
()
const
throw
();
/**
* Returns the density of the tape to be mounted.
*
* @return The density of the tape to be mounted.
*/
virtual
std
::
string
getDensity
()
const
throw
();
/**
* Indicates that the mount was successful.
...
...
scheduler/TapeMount.hpp
View file @
1879f4a0
...
...
@@ -43,6 +43,13 @@ namespace cta {
* @return The volume identifier of the tape to be mounted.
*/
virtual
std
::
string
getVid
()
const
throw
()
=
0
;
/**
* Returns the density of the tape to be mounted.
*
* @return The density of the tape to be mounted.
*/
virtual
std
::
string
getDensity
()
const
throw
()
=
0
;
/**
* Indicates that the mount was successful.
...
...
tapeserver/castor/tape/tapegateway/ClientType.hpp
View file @
1879f4a0
...
...
@@ -38,7 +38,8 @@ namespace castor {
TAPE_GATEWAY
=
0
,
READ_TP
=
1
,
WRITE_TP
=
2
,
DUMP_TP
=
3
DUMP_TP
=
3
,
CTA
=
4
};
/* end of enum ClientType */
/**
...
...
tapeserver/castor/tape/tapeserver/client/ClientInterface.hpp
View file @
1879f4a0
...
...
@@ -37,6 +37,7 @@
#include
"castor/tape/tapegateway/FilesToRecallList.hpp"
#include
"castor/tape/tapegateway/FileRecallReportList.hpp"
#include
"castor/server/Threading.hpp"
#include
"scheduler/MountType.hpp"
namespace
castor
{
namespace
tape
{
...
...
@@ -74,8 +75,8 @@ public :
std
::
string
density
;
/** The label field seems to be in disuse */
std
::
string
labelObsolete
;
/** The
read/write mod
e */
ta
pegateway
::
VolumeMode
volumeMod
e
;
/** The
mount type: archive or retriev
e */
c
ta
::
MountType
::
Enum
mountTyp
e
;
};
/**
...
...
tapeserver/castor/tape/tapeserver/daemon/DataTransferSession.cpp
View file @
1879f4a0
...
...
@@ -89,8 +89,13 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
// 2a) Get initial information from the client
client
::
ClientProxy
::
RequestReport
reqReport
;
try
{
std
::
unique_ptr
<
cta
::
TapeMount
>
tapeMount
(
m_scheduler
.
getNextMount
(
"LLname"
,
"DriveName"
));
//TODO: put right values of logical library and drive name
m_clientProxy
.
fetchVolumeId
(
m_volInfo
,
reqReport
);
std
::
unique_ptr
<
cta
::
TapeMount
>
tapeMount
(
m_scheduler
.
getNextMount
(
m_driveConfig
.
getLogicalLibrary
(),
m_driveConfig
.
getUnitName
()));
m_volInfo
.
vid
=
tapeMount
->
getVid
();
m_volInfo
.
clientType
=
tapegateway
::
ClientType
::
CTA
;
m_volInfo
.
mountType
=
tapeMount
->
getMountType
();
m_volInfo
.
density
=
tapeMount
->
getDensity
();
m_volInfo
.
labelObsolete
=
"AUL"
;
//m_clientProxy.fetchVolumeId(m_volInfo, reqReport);
}
catch
(
client
::
ClientProxy
::
EndOfSessionWithError
&
eoswe
)
{
std
::
stringstream
fullError
;
fullError
<<
"Received end of session with error from client when requesting Volume "
...
...
@@ -151,19 +156,16 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
.
add
(
"density"
,
m_volInfo
.
density
)
.
add
(
"label"
,
m_volInfo
.
labelObsolete
)
.
add
(
"clientType"
,
volumeClientTypeToString
(
m_volInfo
.
clientType
))
.
add
(
"mo
de"
,
volumeMod
eToString
(
m_volInfo
.
volumeMod
e
));
.
add
(
"mo
untType"
,
mountTyp
eToString
(
m_volInfo
.
mountTyp
e
));
lc
.
log
(
LOG_INFO
,
"Got volume from client"
);
}
// Depending on the type of session, branch into the right execution
switch
(
m_volInfo
.
volumeMod
e
)
{
case
ta
pegateway
::
READ
:
switch
(
m_volInfo
.
mountTyp
e
)
{
case
c
ta
::
MountType
::
RETRIEVE
:
return
executeRead
(
lc
);
case
ta
pegateway
::
WRIT
E
:
case
c
ta
::
MountType
::
ARCHIV
E
:
return
executeWrite
(
lc
);
case
tapegateway
::
DUMP
:
executeDump
(
lc
);
return
MARK_DRIVE_AS_UP
;
default:
return
MARK_DRIVE_AS_UP
;
}
...
...
@@ -556,11 +558,10 @@ const char *castor::tape::tapeserver::daemon::DataTransferSession::
// volumeModeToString
//-----------------------------------------------------------------------------
const
char
*
castor
::
tape
::
tapeserver
::
daemon
::
DataTransferSession
::
volumeModeToString
(
const
tapegateway
::
VolumeMode
mode
)
const
throw
()
{
switch
(
mode
)
{
case
tapegateway
::
READ
:
return
"READ"
;
case
tapegateway
::
WRITE
:
return
"WRITE"
;
case
tapegateway
::
DUMP
:
return
"DUMP"
;
default
:
return
"UKNOWN"
;
mountTypeToString
(
const
cta
::
MountType
::
Enum
mountType
)
const
throw
()
{
switch
(
mountType
)
{
case
cta
::
MountType
::
RETRIEVE
:
return
"RETRIEVE"
;
case
cta
::
MountType
::
ARCHIVE
:
return
"ARCHIVE"
;
default
:
return
"UNKNOWN"
;
}
}
tapeserver/castor/tape/tapeserver/daemon/DataTransferSession.hpp
View file @
1879f4a0
...
...
@@ -146,10 +146,9 @@ namespace daemon {
const
throw
();
/**
* Returns the string representation of the specified volume mode from a
* tapegateay::Volume message (READ, WRITE or DUMP).
* Returns the string representation of the specified mount type
*/
const
char
*
volumeMod
eToString
(
const
ta
pegateway
::
VolumeMode
mod
e
)
const
const
char
*
mountTyp
eToString
(
const
c
ta
::
MountType
::
Enum
mountTyp
e
)
const
throw
();
};
}
...
...
tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjectorTest.cpp
View file @
1879f4a0
...
...
@@ -104,7 +104,7 @@ TEST(castor_tape_tapeserver_daemon, RecallTaskInjectorNominal) {
volume
.
density
=
"8000GC"
;
volume
.
labelObsolete
=
"AUL"
;
volume
.
vid
=
"V12345"
;
volume
.
volumeMode
=
castor
::
tape
::
tapegateway
::
READ
;
volume
.
mountType
=
cta
::
MountType
::
RETRIEVE
;
castor
::
tape
::
tapeserver
::
daemon
::
TapeServerReporter
gsr
(
initialProcess
,
DriveConfig
(),
"0.0.0.0"
,
volume
,
lc
);
castor
::
server
::
ProcessCapDummy
cap
;
...
...
@@ -162,7 +162,7 @@ TEST(castor_tape_tapeserver_daemon, RecallTaskInjectorNoFiles) {
volume
.
density
=
"8000GC"
;
volume
.
labelObsolete
=
"AUL"
;
volume
.
vid
=
"V12345"
;
volume
.
volumeMode
=
castor
::
tape
::
tapegateway
::
READ
;
volume
.
mountType
=
cta
::
MountType
::
RETRIEVE
;
castor
::
server
::
ProcessCapDummy
cap
;
castor
::
tape
::
tapeserver
::
daemon
::
TapeServerReporter
tsr
(
initialProcess
,
DriveConfig
(),
"0.0.0.0"
,
volume
,
lc
);
...
...
tapeserver/castor/tape/tapeserver/daemon/TapeReadSingleThread.cpp
View file @
1879f4a0
...
...
@@ -155,6 +155,18 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::openReadSession() {
}
}
//-----------------------------------------------------------------------------
// volumeModeToString
//-----------------------------------------------------------------------------
const
char
*
castor
::
tape
::
tapeserver
::
daemon
::
TapeReadSingleThread
::
mountTypeToString
(
const
cta
::
MountType
::
Enum
mountType
)
const
throw
()
{
switch
(
mountType
)
{
case
cta
::
MountType
::
RETRIEVE
:
return
"RETRIEVE"
;
case
cta
::
MountType
::
ARCHIVE
:
return
"ARCHIVE"
;
default
:
return
"UNKNOWN"
;
}
}
//------------------------------------------------------------------------------
//TapeReadSingleThread::run()
//------------------------------------------------------------------------------
...
...
@@ -171,7 +183,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
typedef
castor
::
log
::
Param
Param
;
m_watchdog
.
addParameter
(
Param
(
"clientType"
,
castor
::
tape
::
tapegateway
::
ClientTypeStrings
[
m_volInfo
.
clientType
]));
m_watchdog
.
addParameter
(
Param
(
"TPVID"
,
m_volInfo
.
vid
));
m_watchdog
.
addParameter
(
Param
(
"
volumeMode"
,
tapegateway
::
VolumeMode
String
s
[
m_volInfo
.
volumeMode
]
));
m_watchdog
.
addParameter
(
Param
(
"
mountType"
,
mountTypeTo
String
(
m_volInfo
.
mountType
)
));
m_watchdog
.
addParameter
(
Param
(
"density"
,
m_volInfo
.
density
));
// Set the tape thread time in the watchdog for total time estimation in case
...
...
tapeserver/castor/tape/tapeserver/daemon/TapeReadSingleThread.hpp
View file @
1879f4a0
...
...
@@ -74,7 +74,14 @@ public:
m_taskInjector
=
ti
;
}
private:
private:
/**
* Returns the string representation of the specified mount type
*/
const
char
*
mountTypeToString
(
const
cta
::
MountType
::
Enum
mountType
)
const
throw
();
//RAII class for cleaning tape stuff
class
TapeCleaning
{
TapeReadSingleThread
&
m_this
;
...
...
tapeserver/castor/tape/tapeserver/daemon/TapeWriteSingleThread.cpp
View file @
1879f4a0
...
...
@@ -115,6 +115,19 @@ isTapeWritable() const {
throw
ex
;
}
}
//-----------------------------------------------------------------------------
// volumeModeToString
//-----------------------------------------------------------------------------
const
char
*
castor
::
tape
::
tapeserver
::
daemon
::
TapeWriteSingleThread
::
mountTypeToString
(
const
cta
::
MountType
::
Enum
mountType
)
const
throw
()
{
switch
(
mountType
)
{
case
cta
::
MountType
::
RETRIEVE
:
return
"RETRIEVE"
;
case
cta
::
MountType
::
ARCHIVE
:
return
"ARCHIVE"
;
default
:
return
"UNKNOWN"
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//run
...
...
@@ -138,7 +151,7 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
typedef
castor
::
log
::
Param
Param
;
m_watchdog
.
addParameter
(
Param
(
"clientType"
,
castor
::
tape
::
tapegateway
::
ClientTypeStrings
[
m_volInfo
.
clientType
]));
m_watchdog
.
addParameter
(
Param
(
"TPVID"
,
m_volInfo
.
vid
));
m_watchdog
.
addParameter
(
Param
(
"
volumeMode"
,
tapegateway
::
VolumeMode
String
s
[
m_volInfo
.
volumeMode
]
));
m_watchdog
.
addParameter
(
Param
(
"
mountType"
,
mountTypeTo
String
(
m_volInfo
.
mountType
)
));
m_watchdog
.
addParameter
(
Param
(
"density"
,
m_volInfo
.
density
));
// Set the tape thread time in the watchdog for total time estimation in case
...
...
tapeserver/castor/tape/tapeserver/daemon/TapeWriteSingleThread.hpp
View file @
1879f4a0
...
...
@@ -87,7 +87,14 @@ public:
void
setTaskInjector
(
MigrationTaskInjector
*
injector
){
m_injector
=
injector
;
}
private:
private:
/**
* Returns the string representation of the specified mount type
*/
const
char
*
mountTypeToString
(
const
cta
::
MountType
::
Enum
mountType
)
const
throw
();
class
TapeCleaning
{
TapeWriteSingleThread
&
m_this
;
// As we are living in the single thread of tape, we can borrow the timer
...
...
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