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
024e8834
Commit
024e8834
authored
Nov 18, 2014
by
Steven Murray
Browse files
Moved DriveConfig and Tpconfig from utils to daemon
parent
18cdb4a7
Changes
49
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/AdminConnectionHandler.cpp
View file @
024e8834
...
...
@@ -185,7 +185,7 @@ void castor::tape::tapeserver::daemon::AdminConnectionHandler::
const
std
::
string
unitName
(
body
.
drive
);
CatalogueDrive
&
drive
=
m_driveCatalogue
.
findDrive
(
unitName
);
const
utils
::
DriveConfig
&
driveConfig
=
drive
.
getConfig
();
const
DriveConfig
&
driveConfig
=
drive
.
getConfig
();
log
::
Param
params
[]
=
{
log
::
Param
(
"unitName"
,
unitName
),
...
...
castor/tape/tapeserver/daemon/CMakeLists.txt
View file @
024e8834
...
...
@@ -4,11 +4,6 @@ add_library(castorTapeServerDaemon
AdminAcceptHandler.cpp
AdminConnectionHandler.cpp
../client/ClientProxy.cpp
DataTransferConfig.cpp
DiskReadThreadPool.cpp
DiskReadTask.cpp
DiskWriteTask.cpp
DiskWriteThreadPool.cpp
Catalogue.cpp
CatalogueDrive.cpp
CatalogueSession.cpp
...
...
@@ -16,6 +11,12 @@ add_library(castorTapeServerDaemon
CatalogueTransferSession.cpp
CatalogueCleanerSession.cpp
CatalogueConfig.cpp
DataTransferConfig.cpp
DiskReadThreadPool.cpp
DiskReadTask.cpp
DiskWriteTask.cpp
DiskWriteThreadPool.cpp
DriveConfigMap.cpp
TapeServerReporter.cpp
LabelCmdAcceptHandler.cpp
LabelCmdConnectionHandler.cpp
...
...
@@ -42,6 +43,8 @@ add_library(castorTapeServerDaemon
TapeReadSingleThread.cpp
TapeWriteSingleThread.cpp
TapeWriteTask.cpp
TpconfigLine.cpp
TpconfigLines.cpp
VdqmAcceptHandler.cpp
VdqmConnectionHandler.cpp
)
...
...
castor/tape/tapeserver/daemon/Catalogue.cpp
View file @
024e8834
...
...
@@ -103,12 +103,12 @@ bool castor::tape::tapeserver::daemon::Catalogue::allDrivesAreShutdown()
// populate
//-----------------------------------------------------------------------------
void
castor
::
tape
::
tapeserver
::
daemon
::
Catalogue
::
populate
(
const
utils
::
DriveConfigMap
&
driveConfigs
)
{
const
DriveConfigMap
&
driveConfigs
)
{
try
{
for
(
utils
::
DriveConfigMap
::
const_iterator
itor
=
driveConfigs
.
begin
();
for
(
DriveConfigMap
::
const_iterator
itor
=
driveConfigs
.
begin
();
itor
!=
driveConfigs
.
end
();
itor
++
)
{
const
std
::
string
&
unitName
=
itor
->
first
;
const
utils
::
DriveConfig
&
driveConfig
=
itor
->
second
;
const
DriveConfig
&
driveConfig
=
itor
->
second
;
// Sanity check
if
(
unitName
!=
driveConfig
.
unitName
)
{
...
...
@@ -132,7 +132,7 @@ void castor::tape::tapeserver::daemon::Catalogue::populate(
// enterDriveConfig
//-----------------------------------------------------------------------------
void
castor
::
tape
::
tapeserver
::
daemon
::
Catalogue
::
enterDriveConfig
(
const
utils
::
DriveConfig
&
driveConfig
)
{
const
DriveConfig
&
driveConfig
)
{
DriveMap
::
iterator
itor
=
m_drives
.
find
(
driveConfig
.
unitName
);
...
...
@@ -227,7 +227,7 @@ const castor::tape::tapeserver::daemon::CatalogueDrive
}
const
CatalogueDrive
&
drive
=
*
(
itor
->
second
);
const
utils
::
DriveConfig
&
driveConfig
=
drive
.
getConfig
();
const
DriveConfig
&
driveConfig
=
drive
.
getConfig
();
// Sanity check
if
(
unitName
!=
driveConfig
.
unitName
)
{
...
...
@@ -267,7 +267,7 @@ castor::tape::tapeserver::daemon::CatalogueDrive
}
CatalogueDrive
&
drive
=
*
(
itor
->
second
);
const
utils
::
DriveConfig
&
driveConfig
=
drive
.
getConfig
();
const
DriveConfig
&
driveConfig
=
drive
.
getConfig
();
// Sanity check
if
(
unitName
!=
driveConfig
.
unitName
)
{
...
...
castor/tape/tapeserver/daemon/Catalogue.hpp
View file @
024e8834
...
...
@@ -30,10 +30,10 @@
#include
"castor/legacymsg/VdqmProxy.hpp"
#include
"castor/legacymsg/VmgrProxy.hpp"
#include
"castor/log/Logger.hpp"
#include
"castor/tape/utils/DriveConfigMap.hpp"
#include
"castor/tape/tapeserver/client/ClientProxy.hpp"
#include
"castor/tape/tapeserver/daemon/CatalogueConfig.hpp"
#include
"castor/tape/tapeserver/daemon/CatalogueDrive.hpp"
#include
"castor/tape/tapeserver/daemon/DriveConfigMap.hpp"
#include
"castor/tape/tapeserver/daemon/ProcessForkerProxy.hpp"
#include
<map>
...
...
@@ -107,7 +107,7 @@ public:
*
* @param driveConfigs Tape-drive configurations.
*/
void
populate
(
const
utils
::
DriveConfigMap
&
driveConfigs
);
void
populate
(
const
DriveConfigMap
&
driveConfigs
);
/**
* Returns a const reference to the tape-drive entry corresponding to the
...
...
@@ -229,7 +229,7 @@ private:
*
* @param driveConfig The tape-drive configuration.
*/
void
enterDriveConfig
(
const
utils
::
DriveConfig
&
driveConfig
);
void
enterDriveConfig
(
const
DriveConfig
&
driveConfig
);
};
// class Catalogue
...
...
castor/tape/tapeserver/daemon/CatalogueCleanerSession.cpp
View file @
024e8834
...
...
@@ -32,7 +32,7 @@ castor::tape::tapeserver::daemon::CatalogueCleanerSession *
castor
::
tape
::
tapeserver
::
daemon
::
CatalogueCleanerSession
::
create
(
log
::
Logger
&
log
,
const
int
netTimeout
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
ProcessForkerProxy
&
processForker
,
const
std
::
string
&
vid
,
const
time_t
assignmentTime
,
...
...
@@ -58,7 +58,7 @@ castor::tape::tapeserver::daemon::CatalogueCleanerSession::
log
::
Logger
&
log
,
const
int
netTimeout
,
const
pid_t
pid
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
const
std
::
string
&
vid
,
const
time_t
assignmentTime
)
throw
()
:
CatalogueSession
(
SESSION_TYPE_CLEANER
,
log
,
netTimeout
,
pid
,
driveConfig
),
...
...
castor/tape/tapeserver/daemon/CatalogueCleanerSession.hpp
View file @
024e8834
...
...
@@ -61,7 +61,7 @@ public:
static
CatalogueCleanerSession
*
create
(
log
::
Logger
&
log
,
const
int
netTimeout
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
ProcessForkerProxy
&
processForker
,
const
std
::
string
&
vid
,
const
time_t
assignmentTime
,
...
...
@@ -153,7 +153,7 @@ protected:
log
::
Logger
&
log
,
const
int
netTimeout
,
const
pid_t
pid
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
const
std
::
string
&
vid
,
const
time_t
assignmentTime
)
throw
();
...
...
castor/tape/tapeserver/daemon/CatalogueDrive.cpp
View file @
024e8834
...
...
@@ -44,7 +44,7 @@ castor::tape::tapeserver::daemon::CatalogueDrive::CatalogueDrive(
legacymsg
::
VdqmProxy
&
vdqm
,
legacymsg
::
VmgrProxy
&
vmgr
,
const
std
::
string
&
hostName
,
const
utils
::
DriveConfig
&
config
,
const
DriveConfig
&
config
,
const
DriveState
state
,
const
time_t
waitJobTimeoutInSecs
,
const
time_t
mountTimeoutInSecs
,
...
...
@@ -116,7 +116,7 @@ const char
//------------------------------------------------------------------------------
// getConfig
//------------------------------------------------------------------------------
const
castor
::
tape
::
utils
::
DriveConfig
const
castor
::
tape
::
tapeserver
::
daemon
::
DriveConfig
&
castor
::
tape
::
tapeserver
::
daemon
::
CatalogueDrive
::
getConfig
()
const
{
return
m_config
;
}
...
...
castor/tape/tapeserver/daemon/CatalogueDrive.hpp
View file @
024e8834
...
...
@@ -34,8 +34,8 @@
#include
"castor/tape/tapeserver/daemon/CatalogueLabelSession.hpp"
#include
"castor/tape/tapeserver/daemon/CatalogueSession.hpp"
#include
"castor/tape/tapeserver/daemon/CatalogueTransferSession.hpp"
#include
"castor/tape/tapeserver/daemon/DriveConfig.hpp"
#include
"castor/tape/tapeserver/daemon/ProcessForkerProxy.hpp"
#include
"castor/tape/utils/DriveConfig.hpp"
#include
<iostream>
#include
<memory>
...
...
@@ -212,7 +212,7 @@ public:
legacymsg
::
VdqmProxy
&
vdqm
,
legacymsg
::
VmgrProxy
&
vmgr
,
const
std
::
string
&
hostName
,
const
utils
::
DriveConfig
&
config
,
const
DriveConfig
&
config
,
const
DriveState
state
,
const
time_t
waitJobTimeoutInSecs
,
const
time_t
mountTimeoutInSecs
,
...
...
@@ -247,7 +247,7 @@ public:
*
* @return The configuration of the tape-drive.
*/
const
tape
::
utils
::
DriveConfig
&
getConfig
()
const
;
const
DriveConfig
&
getConfig
()
const
;
/**
* Gets the current state of the tape drive.
...
...
@@ -492,7 +492,7 @@ private:
/**
* The configuration of the tape-drive.
*/
tape
::
utils
::
DriveConfig
m_config
;
DriveConfig
m_config
;
/**
* The current state of the tape drive.
...
...
castor/tape/tapeserver/daemon/CatalogueLabelSession.cpp
View file @
024e8834
...
...
@@ -34,7 +34,7 @@ castor::tape::tapeserver::daemon::CatalogueLabelSession *
castor
::
tape
::
tapeserver
::
daemon
::
CatalogueLabelSession
::
create
(
log
::
Logger
&
log
,
const
int
netTimeout
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
const
legacymsg
::
TapeLabelRqstMsgBody
&
labelJob
,
const
int
labelCmdConnection
,
legacymsg
::
CupvProxy
&
cupv
,
...
...
@@ -95,7 +95,7 @@ castor::tape::tapeserver::daemon::CatalogueLabelSession::
log
::
Logger
&
log
,
const
int
netTimeout
,
const
pid_t
pid
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
const
castor
::
legacymsg
::
TapeLabelRqstMsgBody
&
labelJob
,
const
int
labelCmdConnection
)
throw
()
:
CatalogueSession
(
SESSION_TYPE_LABEL
,
log
,
netTimeout
,
pid
,
driveConfig
),
...
...
castor/tape/tapeserver/daemon/CatalogueLabelSession.hpp
View file @
024e8834
...
...
@@ -27,8 +27,8 @@
#include
"castor/legacymsg/TapeLabelRqstMsgBody.hpp"
#include
"castor/log/Logger.hpp"
#include
"castor/tape/tapeserver/daemon/CatalogueSession.hpp"
#include
"castor/tape/tapeserver/daemon/DriveConfig.hpp"
#include
"castor/tape/tapeserver/daemon/ProcessForkerProxy.hpp"
#include
"castor/tape/utils/DriveConfig.hpp"
#include
<list>
...
...
@@ -64,7 +64,7 @@ public:
static
CatalogueLabelSession
*
create
(
log
::
Logger
&
log
,
const
int
netTimeout
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
const
castor
::
legacymsg
::
TapeLabelRqstMsgBody
&
labelJob
,
const
int
labelCmdConnection
,
legacymsg
::
CupvProxy
&
cupv
,
...
...
@@ -173,7 +173,7 @@ protected:
log
::
Logger
&
log
,
const
int
netTimeout
,
const
pid_t
pid
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
const
castor
::
legacymsg
::
TapeLabelRqstMsgBody
&
labelJob
,
const
int
labelCmdConnection
)
throw
();
...
...
castor/tape/tapeserver/daemon/CatalogueSession.cpp
View file @
024e8834
...
...
@@ -32,7 +32,7 @@ castor::tape::tapeserver::daemon::CatalogueSession::
log
::
Logger
&
log
,
const
int
netTimeout
,
const
pid_t
pid
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
)
throw
()
:
const
DriveConfig
&
driveConfig
)
throw
()
:
m_sessionType
(
sessionType
),
m_log
(
log
),
m_netTimeout
(
netTimeout
),
...
...
castor/tape/tapeserver/daemon/CatalogueSession.hpp
View file @
024e8834
...
...
@@ -24,7 +24,7 @@
#pragma once
#include
"castor/log/Logger.hpp"
#include
"castor/tape/
utils
/DriveConfig.hpp"
#include
"castor/tape/
tapeserver/daemon
/DriveConfig.hpp"
#include
<string>
#include
<sys/types.h>
...
...
@@ -150,7 +150,7 @@ protected:
log
::
Logger
&
log
,
const
int
netTimeout
,
const
pid_t
pid
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
)
throw
();
const
DriveConfig
&
driveConfig
)
throw
();
/**
* The type of the tape session.
...
...
@@ -175,7 +175,7 @@ protected:
/**
* The configuration of the tape drive.
*/
const
tape
::
utils
::
DriveConfig
&
m_driveConfig
;
const
DriveConfig
&
m_driveConfig
;
};
// class CatalogueSession
...
...
castor/tape/tapeserver/daemon/CatalogueTest.cpp
View file @
024e8834
...
...
@@ -46,13 +46,13 @@ protected:
TEST_F
(
castor_tape_tapeserver_daemon_CatalogueTest
,
goodDayPopulate
)
{
using
namespace
castor
::
tape
::
tapeserver
::
daemon
;
castor
::
tape
::
utils
::
TpconfigLines
lines
;
lines
.
push_back
(
castor
::
tape
::
utils
::
TpconfigLine
(
TpconfigLines
lines
;
lines
.
push_back
(
TpconfigLine
(
"UNIT1"
,
"DGN1"
,
"DEV1"
,
"manual@SLOT1"
));
lines
.
push_back
(
castor
::
tape
::
utils
::
TpconfigLine
(
lines
.
push_back
(
TpconfigLine
(
"UNIT2"
,
"DGN2"
,
"DEV2"
,
"manual@SLOT2"
));
castor
::
tape
::
utils
::
DriveConfigMap
driveConfigs
;
DriveConfigMap
driveConfigs
;
ASSERT_NO_THROW
(
driveConfigs
.
enterTpconfigLines
(
lines
));
castor
::
log
::
DummyLogger
log
(
"unittest"
);
...
...
@@ -82,7 +82,7 @@ TEST_F(castor_tape_tapeserver_daemon_CatalogueTest, goodDayPopulate) {
///////////////////
const
CatalogueDrive
&
unit1
=
catalogue
.
findDrive
(
"UNIT1"
);
const
castor
::
tape
::
utils
::
DriveConfig
&
unit1Config
=
unit1
.
getConfig
();
const
DriveConfig
&
unit1Config
=
unit1
.
getConfig
();
ASSERT_EQ
(
std
::
string
(
"DGN1"
),
unit1Config
.
dgn
);
ASSERT_EQ
(
std
::
string
(
"DEV1"
),
unit1Config
.
devFilename
);
...
...
@@ -97,7 +97,7 @@ TEST_F(castor_tape_tapeserver_daemon_CatalogueTest, goodDayPopulate) {
///////////////////
const
CatalogueDrive
&
unit2
=
catalogue
.
findDrive
(
"UNIT2"
);
const
castor
::
tape
::
utils
::
DriveConfig
&
unit2Config
=
unit2
.
getConfig
();
const
DriveConfig
&
unit2Config
=
unit2
.
getConfig
();
ASSERT_EQ
(
std
::
string
(
"DGN2"
),
unit2Config
.
dgn
);
ASSERT_EQ
(
std
::
string
(
"DEV2"
),
unit2Config
.
devFilename
);
...
...
@@ -111,13 +111,13 @@ TEST_F(castor_tape_tapeserver_daemon_CatalogueTest, goodDayPopulate) {
TEST_F
(
castor_tape_tapeserver_daemon_CatalogueTest
,
duplicateUnitName
)
{
using
namespace
castor
::
tape
::
tapeserver
::
daemon
;
castor
::
tape
::
utils
::
TpconfigLines
lines
;
lines
.
push_back
(
castor
::
tape
::
utils
::
TpconfigLine
(
TpconfigLines
lines
;
lines
.
push_back
(
TpconfigLine
(
"UNIT1"
,
"DGN1"
,
"DEV1"
,
"manual@SLOT1"
));
lines
.
push_back
(
castor
::
tape
::
utils
::
TpconfigLine
(
lines
.
push_back
(
TpconfigLine
(
"UNIT1"
,
"DGN2"
,
"DEV2"
,
"manual@SLOT2"
));
castor
::
tape
::
utils
::
DriveConfigMap
driveConfigs
;
DriveConfigMap
driveConfigs
;
ASSERT_THROW
(
driveConfigs
.
enterTpconfigLines
(
lines
),
castor
::
exception
::
Exception
);
}
...
...
@@ -143,10 +143,10 @@ TEST_F(castor_tape_tapeserver_daemon_CatalogueTest,
TEST_F
(
castor_tape_tapeserver_daemon_CatalogueTest
,
dgnMismatchStart
)
{
using
namespace
castor
::
tape
::
tapeserver
::
daemon
;
castor
::
tape
::
utils
::
TpconfigLines
lines
;
lines
.
push_back
(
castor
::
tape
::
utils
::
TpconfigLine
(
TpconfigLines
lines
;
lines
.
push_back
(
TpconfigLine
(
"UNIT"
,
"DGN1"
,
"DEV"
,
"manual@SLOT"
));
castor
::
tape
::
utils
::
DriveConfigMap
driveConfigs
;
DriveConfigMap
driveConfigs
;
ASSERT_NO_THROW
(
driveConfigs
.
enterTpconfigLines
(
lines
));
const
int
netTimeout
=
1
;
...
...
@@ -179,12 +179,12 @@ TEST_F(castor_tape_tapeserver_daemon_CatalogueTest, dgnMismatchStart) {
TEST_F
(
castor_tape_tapeserver_daemon_CatalogueTest
,
getUnitNames
)
{
using
namespace
castor
::
tape
::
tapeserver
::
daemon
;
castor
::
tape
::
utils
::
TpconfigLines
lines
;
lines
.
push_back
(
castor
::
tape
::
utils
::
TpconfigLine
(
TpconfigLines
lines
;
lines
.
push_back
(
TpconfigLine
(
"UNIT1"
,
"DGN1"
,
"DEV1"
,
"manual@SLOT1"
));
lines
.
push_back
(
castor
::
tape
::
utils
::
TpconfigLine
(
lines
.
push_back
(
TpconfigLine
(
"UNIT2"
,
"DGN2"
,
"DEV2"
,
"manual@SLOT2"
));
castor
::
tape
::
utils
::
DriveConfigMap
driveConfigs
;
DriveConfigMap
driveConfigs
;
ASSERT_NO_THROW
(
driveConfigs
.
enterTpconfigLines
(
lines
));
...
...
castor/tape/tapeserver/daemon/CatalogueTransferSession.cpp
View file @
024e8834
...
...
@@ -41,7 +41,7 @@ castor::tape::tapeserver::daemon::CatalogueTransferSession*
castor
::
tape
::
tapeserver
::
daemon
::
CatalogueTransferSession
::
create
(
log
::
Logger
&
log
,
const
int
netTimeout
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
const
legacymsg
::
RtcpJobRqstMsgBody
&
vdqmJob
,
legacymsg
::
VmgrProxy
&
vmgr
,
legacymsg
::
CupvProxy
&
cupv
,
...
...
@@ -75,7 +75,7 @@ castor::tape::tapeserver::daemon::CatalogueTransferSession::
log
::
Logger
&
log
,
const
int
netTimeout
,
const
pid_t
pid
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
const
legacymsg
::
RtcpJobRqstMsgBody
&
vdqmJob
,
legacymsg
::
VmgrProxy
&
vmgr
,
legacymsg
::
CupvProxy
&
cupv
,
...
...
castor/tape/tapeserver/daemon/CatalogueTransferSession.hpp
View file @
024e8834
...
...
@@ -70,7 +70,7 @@ public:
static
CatalogueTransferSession
*
create
(
log
::
Logger
&
log
,
const
int
netTimeout
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
const
legacymsg
::
RtcpJobRqstMsgBody
&
vdqmJob
,
legacymsg
::
VmgrProxy
&
vmgr
,
legacymsg
::
CupvProxy
&
cupv
,
...
...
@@ -263,7 +263,7 @@ protected:
log
::
Logger
&
log
,
const
int
netTimeout
,
const
pid_t
pid
,
const
tape
::
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
const
legacymsg
::
RtcpJobRqstMsgBody
&
vdqmJob
,
legacymsg
::
VmgrProxy
&
vmgr
,
legacymsg
::
CupvProxy
&
cupv
,
...
...
castor/tape/tapeserver/daemon/CleanerSession.cpp
View file @
024e8834
...
...
@@ -30,7 +30,7 @@ castor::tape::tapeserver::daemon::CleanerSession::CleanerSession(
server
::
ProcessCap
&
capUtils
,
mediachanger
::
MediaChangerFacade
&
mc
,
castor
::
log
::
Logger
&
log
,
const
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
System
::
virtualWrapper
&
sysWrapper
,
const
std
::
string
&
vid
,
const
uint32_t
driveReadyDelayInSeconds
)
:
...
...
castor/tape/tapeserver/daemon/CleanerSession.hpp
View file @
024e8834
...
...
@@ -27,11 +27,11 @@
#include
"castor/log/Logger.hpp"
#include
"castor/mediachanger/MediaChangerFacade.hpp"
#include
"castor/server/ProcessCap.hpp"
#include
"castor/tape/tapeserver/daemon/DriveConfig.hpp"
#include
"castor/tape/tapeserver/daemon/Session.hpp"
#include
"castor/tape/tapeserver/drive/DriveInterface.hpp"
#include
"castor/tape/tapeserver/file/Structures.hpp"
#include
"castor/tape/tapeserver/SCSI/Device.hpp"
#include
"castor/tape/utils/DriveConfig.hpp"
#include
<memory>
...
...
@@ -62,7 +62,7 @@ namespace daemon {
server
::
ProcessCap
&
capUtils
,
mediachanger
::
MediaChangerFacade
&
mc
,
castor
::
log
::
Logger
&
log
,
const
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
System
::
virtualWrapper
&
sysWrapper
,
const
std
::
string
&
vid
,
const
uint32_t
driveReadyDelayInSeconds
);
...
...
@@ -96,7 +96,7 @@ namespace daemon {
/**
* The configuration of the tape drive to be cleaned.
*/
const
utils
::
DriveConfig
m_driveConfig
;
const
DriveConfig
m_driveConfig
;
/**
* The system wrapper used to find the device and instantiate the drive object
...
...
castor/tape/tapeserver/daemon/DataTransferSession.cpp
View file @
024e8834
...
...
@@ -53,7 +53,7 @@ castor::tape::tapeserver::daemon::DataTransferSession::DataTransferSession(
const
legacymsg
::
RtcpJobRqstMsgBody
&
clientRequest
,
castor
::
log
::
Logger
&
log
,
System
::
virtualWrapper
&
sysWrapper
,
const
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
castor
::
mediachanger
::
MediaChangerFacade
&
mc
,
castor
::
messages
::
TapeserverProxy
&
initialProcess
,
castor
::
server
::
ProcessCap
&
capUtils
,
...
...
@@ -421,7 +421,7 @@ void castor::tape::tapeserver::daemon::DataTransferSession::executeDump(log::Log
* @return the drive if found, NULL otherwise
*/
castor
::
tape
::
tapeserver
::
drive
::
DriveInterface
*
castor
::
tape
::
tapeserver
::
daemon
::
DataTransferSession
::
findDrive
(
const
utils
::
DriveConfig
castor
::
tape
::
tapeserver
::
daemon
::
DataTransferSession
::
findDrive
(
const
DriveConfig
&
driveConfig
,
log
::
LogContext
&
lc
)
{
// Find the drive in the system's SCSI devices
castor
::
tape
::
SCSI
::
DeviceVector
dv
(
m_sysWrapper
);
...
...
castor/tape/tapeserver/daemon/DataTransferSession.hpp
View file @
024e8834
...
...
@@ -31,6 +31,7 @@
#include
"castor/server/ProcessCap.hpp"
#include
"castor/tape/tapeserver/client/ClientProxy.hpp"
#include
"castor/tape/tapeserver/daemon/DataTransferConfig.hpp"
#include
"castor/tape/tapeserver/daemon/DriveConfig.hpp"
#include
"castor/tape/tapeserver/daemon/Session.hpp"
#include
"castor/tape/tapeserver/daemon/TapeSingleThreadInterface.hpp"
#include
"castor/tape/tapeserver/system/Wrapper.hpp"
...
...
@@ -61,7 +62,7 @@ namespace daemon {
const
legacymsg
::
RtcpJobRqstMsgBody
&
clientRequest
,
castor
::
log
::
Logger
&
log
,
System
::
virtualWrapper
&
sysWrapper
,
const
utils
::
DriveConfig
&
driveConfig
,
const
DriveConfig
&
driveConfig
,
castor
::
mediachanger
::
MediaChangerFacade
&
mc
,
castor
::
messages
::
TapeserverProxy
&
initialProcess
,
castor
::
server
::
ProcessCap
&
capUtils
,
...
...
@@ -112,13 +113,13 @@ namespace daemon {
/**
* The configuration of the tape drive to be used by this session.
*/
const
utils
::
DriveConfig
m_driveConfig
;
const
DriveConfig
m_driveConfig
;
const
DataTransferConfig
&
m_castorConf
;
/** utility to find the drive on the system. This function logs
* all errors and hence does not throw exceptions. It returns NULL
* in case of failure. */
castor
::
tape
::
tapeserver
::
drive
::
DriveInterface
*
findDrive
(
const
utils
::
DriveConfig
&
driveConfig
,
log
::
LogContext
&
lc
);
const
DriveConfig
&
driveConfig
,
log
::
LogContext
&
lc
);
/** sub-part of execute for the read sessions */
EndOfSessionAction
executeRead
(
log
::
LogContext
&
lc
);
...
...
castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp
View file @
024e8834
...
...
@@ -152,7 +152,7 @@ TEST(tapeServer, DataTransferSessionGooddayRecall) {
sim
.
addFileToRecall
(
ftr
,
sizeof
(
data
));
}
}
castor
::
tape
::
utils
::
DriveConfig
driveConfig
;
DriveConfig
driveConfig
;
driveConfig
.
unitName
=
"T10D6116"
;
driveConfig
.
dgn
=
"T10KD6"
;
driveConfig
.
devFilename
=
"/dev/tape_T10D6116"
;
...
...
@@ -257,7 +257,7 @@ TEST(tapeServer, DataTransferSessionWrongRecall) {
sim
.
addFileToRecall
(
ftr
,
sizeof
(
data
));
}
}
castor
::
tape
::
utils
::
DriveConfig
driveConfig
;
DriveConfig
driveConfig
;
driveConfig
.
unitName
=
"T10D6116"
;
driveConfig
.
dgn
=
"T10KD6"
;
driveConfig
.
devFilename
=
"/dev/tape_T10D6116"
;
...
...
@@ -315,7 +315,7 @@ TEST(tapeServer, DataTransferSessionNoSuchDrive) {
mockSys
.
delegateToFake
();
mockSys
.
disableGMockCallsCounting
();
mockSys
.
fake
.
setupForVirtualDriveSLC6
();
castor
::
tape
::
utils
::
DriveConfig
driveConfig
;
DriveConfig
driveConfig
;
driveConfig
.
unitName
=
"T10D6116"
;
driveConfig
.
dgn
=
"T10KD6"
;
driveConfig
.
devFilename
=
"/dev/noSuchTape"
;
...
...
@@ -403,7 +403,7 @@ TEST(tapeServer, DataTransferSessionFailtoMount) {
sim
.
addFileToRecall
(
ftr
,
1000
);
}
}
castor
::
tape
::
utils
::
DriveConfig
driveConfig
;
DriveConfig
driveConfig
;
driveConfig
.
unitName
=
"T10D6116"
;
driveConfig
.
dgn
=
"T10KD6"
;
driveConfig
.
devFilename
=
"/dev/tape_T10D6116"
;
...
...
@@ -467,7 +467,7 @@ TEST(tapeServer, DataTransferSessionEmptyOnVolReq) {
// The drive will not even be opened. so no need for one.
mockSys
.
fake
.
m_pathToDrive
[
"/dev/nst0"
]
=
NULL
;
castor
::
tape
::
utils
::
DriveConfig
driveConfig
;
DriveConfig
driveConfig
;
driveConfig
.
unitName
=
"T10D6116"
;
driveConfig
.
dgn
=
"T10KD6"
;
driveConfig
.
devFilename
=
"/dev/tape_T10D6116"
;
...
...
@@ -615,7 +615,7 @@ TEST(tapeServer, DataTransferSessionGooddayMigration) {
expected
.
push_back
(
expectedResult
(
fseq
,
tf
->
checksum
()));
tempFiles
.
push_back
(
tf
.
release
());
}
castor
::
tape
::
utils
::
DriveConfig
driveConfig
;
DriveConfig
driveConfig
;
driveConfig
.
unitName
=
"T10D6116"
;
driveConfig
.
dgn
=
"T10KD6"
;
driveConfig
.
devFilename
=
"/dev/tape_T10D6116"
;
...
...
@@ -705,7 +705,7 @@ TEST(tapeServer, DataTransferSessionMissingFilesMigration) {
ftm
.
setPath
(
tf
->
path
());
sim
.
addFileToMigrate
(
ftm
);
}
castor
::
tape
::
utils
::
DriveConfig
driveConfig
;
DriveConfig
driveConfig
;
driveConfig
.
unitName
=
"T10D6116"
;
driveConfig
.
dgn
=
"T10KD6"
;
driveConfig
.
devFilename
=
"/dev/tape_T10D6116"
;
...
...
@@ -807,7 +807,7 @@ TEST(tapeServer, DataTransferSessionTapeFullMigration) {
}
tempFiles
.
push_back
(
tf
.
release
());
}
castor
::
tape
::
utils
::
DriveConfig
driveConfig
;
DriveConfig
driveConfig
;
driveConfig
.
unitName
=
"T10D6116"
;
driveConfig
.
dgn
=
"T10KD6"
;
driveConfig
.
devFilename
=
"/dev/tape_T10D6116"
;
...
...
@@ -914,7 +914,7 @@ TEST(tapeServer, DataTransferSessionTapeFullOnFlushMigration) {
}
tempFiles
.
push_back
(
tf
.
release
());
}
castor
::
tape
::
utils
::
DriveConfig
driveConfig
;
DriveConfig
driveConfig
;
driveConfig
.
unitName
=
"T10D6116"
;
driveConfig
.
dgn
=
"T10KD6"
;
driveConfig
.
devFilename
=
"/dev/tape_T10D6116"
;
...
...
Prev
1
2
3
Next
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