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
5215b1fe
Commit
5215b1fe
authored
Nov 06, 2014
by
Steven Murray
Browse files
TapeDaemonConfig now contains ProcessForkerConfig which contains DataTransferConfig
parent
a1daca81
Changes
10
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/CMakeLists.txt
View file @
5215b1fe
...
...
@@ -25,8 +25,8 @@ add_library(castorTapeServerDaemon
MigrationTaskInjector.cpp
DataTransferSession.cpp
ProcessForker.cpp
ProcessForkerConfig.cpp
ProcessForkerConnectionHandler.cpp
ProcessForkerOneTimeConfig.cpp
ProcessForkerProxy.cpp
ProcessForkerProxyDummy.cpp
ProcessForkerProxySocket.cpp
...
...
castor/tape/tapeserver/daemon/DataTransferConfig.hpp
View file @
5215b1fe
...
...
@@ -34,11 +34,7 @@ namespace tapeserver {
namespace
daemon
{
/**
* The contents of the castor.conf file to be used by the
* DataTransferSession.
*
* The pre-extraction of the contents by the caller instead of direct
* getconfent() calls facilitates unit-testing.
* The contents of the castor.conf file to be used by a DataTransferSession.
*/
struct
DataTransferConfig
{
...
...
castor/tape/tapeserver/daemon/ProcessForker.cpp
View file @
5215b1fe
...
...
@@ -66,7 +66,7 @@ castor::tape::tapeserver::daemon::ProcessForker::ProcessForker(
const
int
reaperSocket
,
const
std
::
string
&
hostName
,
char
*
const
argv0
,
const
ProcessForker
OneTime
Config
&
config
)
throw
()
:
const
ProcessForkerConfig
&
config
)
throw
()
:
m_log
(
log
),
m_cmdSocket
(
cmdSocket
),
m_reaperSocket
(
reaperSocket
),
...
...
castor/tape/tapeserver/daemon/ProcessForker.hpp
View file @
5215b1fe
...
...
@@ -29,8 +29,8 @@
#include
"castor/messages/ForkDataTransfer.pb.h"
#include
"castor/messages/ForkLabel.pb.h"
#include
"castor/tape/tapeserver/daemon/DataTransferSession.hpp"
#include
"castor/tape/tapeserver/daemon/ProcessForkerConfig.hpp"
#include
"castor/tape/tapeserver/daemon/ProcessForkerFrame.hpp"
#include
"castor/tape/tapeserver/daemon/ProcessForkerOneTimeConfig.hpp"
#include
<stdint.h>
...
...
@@ -65,7 +65,7 @@ public:
*/
ProcessForker
(
log
::
Logger
&
log
,
const
int
cmdSocket
,
const
int
reaperSocket
,
const
std
::
string
&
hostName
,
char
*
const
argv0
,
const
ProcessForker
OneTime
Config
&
config
)
throw
();
const
ProcessForkerConfig
&
config
)
throw
();
/**
* Destructor.
...
...
@@ -116,10 +116,9 @@ private:
char
*
const
m_argv0
;
/**
* The CASTOR configuration parameters used by the ProcessForker for the
* entire lifetime of the process.
* The CASTOR configuration parameters used by the ProcessForker.
*/
const
ProcessForker
OneTime
Config
m_config
;
const
ProcessForkerConfig
m_config
;
/**
* Idempotent method that closes the socket used for receving commands
...
...
castor/tape/tapeserver/daemon/ProcessForker
OneTime
Config.cpp
→
castor/tape/tapeserver/daemon/ProcessForkerConfig.cpp
View file @
5215b1fe
...
...
@@ -22,26 +22,26 @@
*****************************************************************************/
#include
"castor/common/CastorConfiguration.hpp"
#include
"castor/tape/tapeserver/daemon/ProcessForker
OneTime
Config.hpp"
#include
"castor/tape/tapeserver/daemon/ProcessForkerConfig.hpp"
#include
"h/rmc_constants.h"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
castor
::
tape
::
tapeserver
::
daemon
::
ProcessForker
OneTime
Config
::
ProcessForker
OneTime
Config
()
:
castor
::
tape
::
tapeserver
::
daemon
::
ProcessForkerConfig
::
ProcessForkerConfig
()
:
rmcPort
(
0
)
{
}
//------------------------------------------------------------------------------
// createFromCastorConfig
//------------------------------------------------------------------------------
castor
::
tape
::
tapeserver
::
daemon
::
ProcessForker
OneTime
Config
castor
::
tape
::
tapeserver
::
daemon
::
ProcessForker
OneTime
Config
::
castor
::
tape
::
tapeserver
::
daemon
::
ProcessForkerConfig
castor
::
tape
::
tapeserver
::
daemon
::
ProcessForkerConfig
::
createFromCastorConf
(
log
::
Logger
*
const
log
)
{
common
::
CastorConfiguration
&
castorConf
=
common
::
CastorConfiguration
::
getConfig
();
ProcessForker
OneTime
Config
config
;
ProcessForkerConfig
config
;
config
.
rmcPort
=
castorConf
.
getConfEntInt
(
"RMC"
,
"PORT"
,
(
unsigned
short
)
RMC_PORT
,
log
);
...
...
castor/tape/tapeserver/daemon/ProcessForker
OneTime
Config.hpp
→
castor/tape/tapeserver/daemon/ProcessForkerConfig.hpp
View file @
5215b1fe
...
...
@@ -32,9 +32,9 @@ namespace daemon {
/**
* Structure containing the CASTOR configuration parameters used by the
* ProcessForker
for the entire lifetime of the process
.
* ProcessForker.
*/
struct
ProcessForker
OneTime
Config
{
struct
ProcessForkerConfig
{
/**
* The TCP/IP port on which the rmcd daemon is listening.
...
...
@@ -50,7 +50,7 @@ struct ProcessForkerOneTimeConfig {
* Constructor that sets all integer member-variables to 0 and all string
* member-variables to the emptry string.
*/
ProcessForker
OneTime
Config
();
ProcessForkerConfig
();
/**
* Returns a configuration structure based on the contents of
...
...
@@ -59,10 +59,10 @@ struct ProcessForkerOneTimeConfig {
* @param log pointer to NULL or an optional logger object.
* @return The configuration structure.
*/
static
ProcessForker
OneTime
Config
createFromCastorConf
(
static
ProcessForkerConfig
createFromCastorConf
(
log
::
Logger
*
const
log
=
NULL
);
};
// class ProcessForker
OneTime
Config
};
// class ProcessForkerConfig
}
// namespace daemon
}
// namespace tapeserver
...
...
castor/tape/tapeserver/daemon/ProcessForkerTest.cpp
View file @
5215b1fe
...
...
@@ -60,7 +60,7 @@ TEST_F(castor_tape_tapeserver_daemon_ProcessForkerTest, constructor) {
const
std
::
string
hostName
=
"hostName"
;
castor
::
log
::
DummyLogger
log
(
programName
);
char
argv0
[
12
]
=
"tapeserverd"
;
ProcessForker
OneTime
Config
processForkerConfig
;
ProcessForkerConfig
processForkerConfig
;
std
::
auto_ptr
<
ProcessForker
>
processForker
;
ASSERT_NO_THROW
(
processForker
.
reset
(
new
ProcessForker
(
log
,
cmdReceiverSocket
.
get
(),
reaperSenderSocket
.
get
(),
...
...
@@ -85,7 +85,7 @@ TEST_F(castor_tape_tapeserver_daemon_ProcessForkerTest, socketproxy) {
const
std
::
string
hostName
=
"hostName"
;
castor
::
log
::
DummyLogger
log
(
programName
);
char
argv0
[
12
]
=
"tapeserverd"
;
ProcessForker
OneTime
Config
processForkerConfig
;
ProcessForkerConfig
processForkerConfig
;
std
::
auto_ptr
<
ProcessForker
>
processForker
;
ASSERT_NO_THROW
(
processForker
.
reset
(
new
ProcessForker
(
log
,
cmdReceiverSocket
.
get
(),
reaperSenderSocket
.
get
(),
...
...
castor/tape/tapeserver/daemon/TapeDaemon.cpp
View file @
5215b1fe
...
...
@@ -208,8 +208,8 @@ void castor::tape::tapeserver::daemon::TapeDaemon::exceptionThrowingMain(
m_processForkerPid
=
forkProcessForker
(
cmdPair
,
reaperPair
);
const
ProcessForker
OneTime
Config
processForkerConfig
=
ProcessForker
OneTime
Config
::
createFromCastorConf
(
&
m_log
);
const
ProcessForkerConfig
processForkerConfig
=
ProcessForkerConfig
::
createFromCastorConf
(
&
m_log
);
m_processForker
=
new
ProcessForkerProxySocket
(
m_log
,
cmdPair
.
tapeDaemon
);
m_catalogue
=
new
Catalogue
(
m_netTimeout
,
...
...
@@ -542,8 +542,8 @@ void castor::tape::tapeserver::daemon::TapeDaemon::
int
castor
::
tape
::
tapeserver
::
daemon
::
TapeDaemon
::
runProcessForker
(
const
int
cmdReceiverSocket
,
const
int
reaperSenderSocket
)
throw
()
{
try
{
const
ProcessForker
OneTime
Config
processForkerConfig
=
ProcessForker
OneTime
Config
::
createFromCastorConf
();
const
ProcessForkerConfig
processForkerConfig
=
ProcessForkerConfig
::
createFromCastorConf
();
ProcessForker
processForker
(
m_log
,
cmdReceiverSocket
,
reaperSenderSocket
,
m_hostName
,
m_argv
[
0
],
processForkerConfig
);
processForker
.
execute
();
...
...
castor/tape/tapeserver/daemon/TapeDaemonConfig.cpp
View file @
5215b1fe
...
...
@@ -46,7 +46,7 @@ castor::tape::tapeserver::daemon::TapeDaemonConfig
TapeDaemonConfig
config
;
config
.
dataTransferConfig
=
DataTransf
erConfig
::
createFromCastorConf
(
log
);
config
.
processForkerConfig
=
ProcessFork
erConfig
::
createFromCastorConf
(
log
);
config
.
waitJobTimeoutInSecs
=
castorConf
.
getConfEntInt
(
"TAPESERVERD"
,
"WAITJOBTIMEOUT"
,
(
time_t
)
TAPESERVER_WAITJOBTIMEOUT_DEFAULT
,
log
);
...
...
castor/tape/tapeserver/daemon/TapeDaemonConfig.hpp
View file @
5215b1fe
...
...
@@ -24,7 +24,7 @@
#pragma once
#include
"castor/log/Logger.hpp"
#include
"castor/tape/tapeserver/daemon/
DataTransf
erConfig.hpp"
#include
"castor/tape/tapeserver/daemon/
ProcessFork
erConfig.hpp"
#include
<stdint.h>
#include
<string>
...
...
@@ -36,20 +36,13 @@ namespace daemon {
/**
* The contents of the castor.conf file to be used by the tape-server daemon.
*
* The pre-extraction of the contents by the caller instead of direct
* getconfent() calls facilitates unit-testing.
*/
struct
TapeDaemonConfig
{
/**
* The contents of the castor.conf file to be used by the
* DataTransferSession.
*
* The pre-extraction of the contents by the caller instead of direct
* getconfent() calls facilitates unit-testing.
* The CASTOR configuration parameters used by the ProcessForker.
*/
DataTransferConfig
dataTransf
erConfig
;
ProcessForkerConfig
processFork
erConfig
;
/**
* The maximum time in seconds that the data-transfer session can take to get
...
...
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