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
3c603051
Commit
3c603051
authored
Oct 26, 2015
by
Daniele Kruse
Browse files
Removed classes nested in functions, added debug information when no new mount is available
parent
3e1289a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
tapeserver/castor/tape/tapeserver/daemon/CMakeLists.txt
View file @
3c603051
...
...
@@ -74,7 +74,7 @@ add_library(castorTapeServerDaemon
TpconfigLine.cpp
TpconfigLines.cpp
)
target_link_libraries
(
castorTapeServerDaemon castormessages castortapereactor ctacommon ctanameserver ctaremotens ctaOStoreSchedulerDB protobuf CTAObjectStore ctascheduler
)
target_link_libraries
(
castorTapeServerDaemon castormessages castortapereactor ctacommon ctanameserver ctaremotens ctaOStoreSchedulerDB protobuf CTAObjectStore ctascheduler
XrdCtaOfs
)
add_dependencies
(
castorTapeServerDaemon castormessagesprotobuf
)
add_executable
(
tapeserverd TapeDaemon.cpp
)
...
...
tapeserver/castor/tape/tapeserver/daemon/DataTransferSession.cpp
View file @
3c603051
...
...
@@ -97,8 +97,10 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
return
MARK_DRIVE_AS_DOWN
;
}
// No mount to be done found, that was fast...
if
(
!
tapeMount
.
get
())
if
(
!
tapeMount
.
get
())
{
lc
.
log
(
LOG_INFO
,
"No new mount found!"
);
return
MARK_DRIVE_AS_UP
;
}
m_volInfo
.
vid
=
tapeMount
->
getVid
();
m_volInfo
.
mountType
=
tapeMount
->
getMountType
();
m_volInfo
.
nbFiles
=
tapeMount
->
getNbFiles
();
...
...
tapeserver/castor/tape/tapeserver/daemon/ProcessForker.cpp
View file @
3c603051
...
...
@@ -54,8 +54,9 @@
#include
"scheduler/OStoreDB/OStoreDB.hpp"
#include
"scheduler/Scheduler.hpp"
#include
"serrno.h"
#include
"nameserver/mockNS/MockNameServer.hpp"
#include
"xroot_plugins/BackendPopulator.hpp"
#include
"xroot_plugins/OStoreDBWithAgent.hpp"
#include
<errno.h>
#include
<memory>
...
...
@@ -555,60 +556,13 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
messages
::
TapeserverProxyZmq
tapeserver
(
m_log
,
m_config
.
internalPort
,
zmqContext
.
get
());
/************BEGIN: boilerplate code to prepare the objectstoreDB object**************/
cta
::
objectstore
::
BackendVFS
g_backend
(
m_config
.
objectStoreBackendPath
);
// Make sure we will not delete the contents of objectstore when deleting the object
g_backend
.
noDeleteOnExit
();
class
BackendPopulator
{
public:
BackendPopulator
(
cta
::
objectstore
::
Backend
&
be
)
:
m_backend
(
be
),
m_agent
(
m_backend
)
{
// We need to populate the root entry before using.
cta
::
objectstore
::
RootEntry
re
(
m_backend
);
cta
::
objectstore
::
ScopedExclusiveLock
rel
(
re
);
re
.
fetch
();
m_agent
.
generateName
(
"OStoreDBFactory"
);
m_agent
.
initialize
();
cta
::
objectstore
::
CreationLog
cl
(
cta
::
UserIdentity
(
1111
,
1111
),
"systemhost"
,
time
(
NULL
),
"Initial creation of the object store structures"
);
re
.
addOrGetAgentRegisterPointerAndCommit
(
m_agent
,
cl
);
rel
.
release
();
m_agent
.
insertAndRegisterSelf
();
rel
.
lock
(
re
);
re
.
addOrGetDriveRegisterPointerAndCommit
(
m_agent
,
cl
);
rel
.
release
();
}
virtual
~
BackendPopulator
()
throw
()
{
cta
::
objectstore
::
ScopedExclusiveLock
agl
(
m_agent
);
m_agent
.
fetch
();
m_agent
.
removeAndUnregisterSelf
();
}
cta
::
objectstore
::
Agent
&
getAgent
()
{
return
m_agent
;
}
private:
cta
::
objectstore
::
Backend
&
m_backend
;
cta
::
objectstore
::
Agent
m_agent
;
}
g_backendPopulator
(
g_backend
);
class
OStoreDBWithAgent
:
public
cta
::
OStoreDB
{
public:
OStoreDBWithAgent
(
cta
::
objectstore
::
Backend
&
be
,
cta
::
objectstore
::
Agent
&
ag
)
:
cta
::
OStoreDB
(
be
)
{
cta
::
OStoreDB
::
setAgent
(
ag
);
}
virtual
~
OStoreDBWithAgent
()
throw
()
{
cta
::
OStoreDB
::
setAgent
(
*
((
cta
::
objectstore
::
Agent
*
)
NULL
));
}
}
g_OStoreDB
(
g_backend
,
g_backendPopulator
.
getAgent
());
/************END: boilerplate code to prepare the objectstoreDB object**************/
cta
::
EosNS
eosNs
(
"localhost:1094"
);
cta
::
CastorNameServer
castorNs
;
cta
::
MockNameServer
mockNs
(
castor
::
common
::
CastorConfiguration
::
getConfig
().
getConfEntString
(
"TapeServer"
,
"MockNameServerPath"
));
cta
::
objectstore
::
BackendVFS
backend
(
castor
::
common
::
CastorConfiguration
::
getConfig
().
getConfEntString
(
"TapeServer"
,
"ObjectStoreBackendPath"
));
BackendPopulator
backendPopulator
(
backend
);
OStoreDBWithAgent
osdb
(
backend
,
backendPopulator
.
getAgent
());
cta
::
Scheduler
scheduler
(
castorNs
,
g_OStoreDB
,
eosNs
);
cta
::
Scheduler
scheduler
(
mockNs
,
osdb
,
eosNs
);
castor
::
tape
::
System
::
realWrapper
sysWrapper
;
...
...
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