Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
63704d7b
Commit
63704d7b
authored
7 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[cta-frontend] Reads config values from XRootD config file
parent
06ac9900
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
xroot_plugins/XrdSsiCtaServiceProvider.cpp
+20
-11
20 additions, 11 deletions
xroot_plugins/XrdSsiCtaServiceProvider.cpp
xroot_plugins/XrdSsiCtaServiceProvider.hpp
+1
-4
1 addition, 4 deletions
xroot_plugins/XrdSsiCtaServiceProvider.hpp
with
21 additions
and
15 deletions
xroot_plugins/XrdSsiCtaServiceProvider.cpp
+
20
−
11
View file @
63704d7b
...
...
@@ -58,10 +58,10 @@ bool XrdSsiCtaServiceProvider::Init(XrdSsiLogger *logP, XrdSsiCluster *clsP, con
Log
::
Msg
(
XrdSsiPb
::
Log
::
INFO
,
LOG_SUFFIX
,
"Called Init("
,
cfgFn
,
','
,
parms
,
')'
);
// Read CTA namespaced configuration options from XRootD config file
Config
config
(
cfgFn
,
"cta"
);
Config
config
(
cfgFn
);
// Set XRootD SSI Protobuf logging level
auto
loglevel
=
config
.
getOptionList
(
"log.ssi"
);
auto
loglevel
=
config
.
getOptionList
(
"
cta.
log.ssi"
);
if
(
!
loglevel
.
empty
())
{
Log
::
SetLogLevel
(
loglevel
);
}
else
{
...
...
@@ -70,15 +70,17 @@ bool XrdSsiCtaServiceProvider::Init(XrdSsiLogger *logP, XrdSsiCluster *clsP, con
// Instantiate the CTA logging system
try
{
std
::
string
loggerURL
=
m_ctaConf
.
getConfEntString
(
"Log"
,
"URL"
,
"syslog:"
);
if
(
loggerURL
==
"syslog:"
)
{
auto
loggerURL
=
config
.
getOptionValueStr
(
"cta.log.url"
);
if
(
!
loggerURL
.
first
)
loggerURL
.
second
=
"syslog:"
;
if
(
loggerURL
.
second
==
"syslog:"
)
{
m_log
.
reset
(
new
log
::
SyslogLogger
(
"cta-frontend"
,
log
::
DEBUG
));
}
else
if
(
loggerURL
==
"stdout:"
)
{
}
else
if
(
loggerURL
.
second
==
"stdout:"
)
{
m_log
.
reset
(
new
log
::
StdoutLogger
(
"cta-frontend"
));
}
else
if
(
loggerURL
.
substr
(
0
,
5
)
==
"file:"
)
{
m_log
.
reset
(
new
log
::
FileLogger
(
"cta-frontend"
,
loggerURL
.
substr
(
5
),
log
::
DEBUG
));
}
else
if
(
loggerURL
.
second
.
substr
(
0
,
5
)
==
"file:"
)
{
m_log
.
reset
(
new
log
::
FileLogger
(
"cta-frontend"
,
loggerURL
.
second
.
substr
(
5
),
log
::
DEBUG
));
}
else
{
throw
exception
::
Exception
(
std
::
string
(
"Unknown log URL: "
)
+
loggerURL
);
throw
exception
::
Exception
(
std
::
string
(
"Unknown log URL: "
)
+
loggerURL
.
second
);
}
}
catch
(
exception
::
Exception
&
ex
)
{
std
::
string
ex_str
(
"Failed to instantiate object representing CTA logging system: "
);
...
...
@@ -90,13 +92,20 @@ bool XrdSsiCtaServiceProvider::Init(XrdSsiLogger *logP, XrdSsiCluster *clsP, con
// Initialise the catalogue
const
rdbms
::
Login
catalogueLogin
=
rdbms
::
Login
::
parseFile
(
"/etc/cta/cta-catalogue.conf"
);
const
uint64_t
nbConns
=
m_ctaConf
.
getConfEntInt
<
uint64_t
>
(
"Catalogue"
,
"NumberOfConnections"
,
nullptr
);
auto
catalogue_numberofconnections
=
config
.
getOptionValueInt
(
"cta.catalogue.numberofconnections"
);
if
(
!
catalogue_numberofconnections
.
first
)
{
throw
exception
::
Exception
(
"cta.catalogue.numberofconnections is not set in configuration filei "
+
cfgFn
);
}
const
uint64_t
nbArchiveFileListingConns
=
2
;
m_catalogue
=
catalogue
::
CatalogueFactory
::
create
(
*
m_log
,
catalogueLogin
,
nbConns
,
nbArchiveFileListingConns
);
m_catalogue
=
catalogue
::
CatalogueFactory
::
create
(
*
m_log
,
catalogueLogin
,
catalogue_numberofconnections
.
second
,
nbArchiveFileListingConns
);
// Initialise the Backend
m_backend
=
std
::
move
(
cta
::
objectstore
::
BackendFactory
::
createBackend
(
m_ctaConf
.
getConfEntString
(
"ObjectStore"
,
"BackendPath"
,
nullptr
),
*
m_log
));
auto
objectstore_backendpath
=
config
.
getOptionValueStr
(
"cta.objectstore.backendpath"
);
if
(
!
objectstore_backendpath
.
first
)
{
throw
exception
::
Exception
(
"cta.objectstore.backendpath is not set in configuration file "
+
cfgFn
);
}
m_backend
=
std
::
move
(
cta
::
objectstore
::
BackendFactory
::
createBackend
(
objectstore_backendpath
.
second
,
*
m_log
));
m_backendPopulator
=
cta
::
make_unique
<
cta
::
objectstore
::
BackendPopulator
>
(
*
m_backend
,
"Frontend"
,
cta
::
log
::
LogContext
(
*
m_log
));
m_scheddb
=
cta
::
make_unique
<
cta
::
OStoreDBWithAgent
>
(
*
m_backend
,
m_backendPopulator
->
getAgentReference
(),
*
m_catalogue
,
*
m_log
);
...
...
This diff is collapsed.
Click to expand it.
xroot_plugins/XrdSsiCtaServiceProvider.hpp
+
1
−
4
View file @
63704d7b
...
...
@@ -44,8 +44,7 @@ extern XrdSsiProvider *XrdSsiProviderServer;
class
XrdSsiCtaServiceProvider
:
public
XrdSsiProvider
{
public:
XrdSsiCtaServiceProvider
()
:
m_ctaConf
(
"/etc/cta/cta-frontend.conf"
)
{
XrdSsiCtaServiceProvider
()
{
XrdSsiPb
::
Log
::
Msg
(
XrdSsiPb
::
Log
::
DEBUG
,
LOG_SUFFIX
,
"XrdSsiCtaServiceProvider() constructor"
);
}
...
...
@@ -108,8 +107,6 @@ private:
// Member variables
cta
::
common
::
Configuration
m_ctaConf
;
//!< CTA configuration
std
::
unique_ptr
<
cta
::
objectstore
::
Backend
>
m_backend
;
//!< VFS backend for the objectstore DB
std
::
unique_ptr
<
cta
::
objectstore
::
BackendPopulator
>
m_backendPopulator
;
//!< Object used to populate the backend
std
::
unique_ptr
<
cta
::
OStoreDBWithAgent
>
m_scheddb
;
//!< DB/Object Store of persistent objects
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment