Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
bc6dc415
Commit
bc6dc415
authored
Oct 18, 2019
by
Carla Guillen Carias
Browse files
Adding check for the type of backend
parent
398fa5ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
analytics/operators/persystsql/PerSystSqlConfigurator.cpp
View file @
bc6dc415
...
...
@@ -73,8 +73,9 @@ void PerSystSqlConfigurator::operatorAttributes(PerSystSqlOperator& op, CFG_VAL
std
::
string
user
;
std
::
string
password
;
std
::
string
database_name
;
int
port
;
int
port
=
-
1
;
PerSystDB
::
Rotation_t
rotation
=
PerSystDB
::
EVERY_MONTH
;
PerSystSqlOperator
::
Backend_t
backend
=
PerSystSqlOperator
::
DEFAULT
;
unsigned
int
every_x_days
=
0
;
BOOST_FOREACH
(
boost
::
property_tree
::
iptree
::
value_type
&
val
,
config
)
{
if
(
boost
::
iequals
(
val
.
first
,
"number_quantiles"
))
{
...
...
@@ -105,8 +106,10 @@ void PerSystSqlConfigurator::operatorAttributes(PerSystSqlOperator& op, CFG_VAL
op
.
setSeverityMaxMemory
(
max_memory
);
}
else
if
(
boost
::
iequals
(
val
.
first
,
"backend"
))
{
if
(
val
.
second
.
data
()
==
"cassandra"
)
{
backend
=
PerSystSqlOperator
::
CASSANDRA
;
op
.
setBackend
(
PerSystSqlOperator
::
CASSANDRA
);
}
else
if
(
val
.
second
.
data
()
==
"mariadb"
)
{
backend
=
PerSystSqlOperator
::
MARIADB
;
op
.
setBackend
(
PerSystSqlOperator
::
MARIADB
);
}
}
else
if
(
boost
::
iequals
(
val
.
first
,
"property_id"
)){
...
...
@@ -132,7 +135,9 @@ void PerSystSqlConfigurator::operatorAttributes(PerSystSqlOperator& op, CFG_VAL
}
else
if
(
boost
::
iequals
(
val
.
first
,
"mariadb_every_x_days"
)){
every_x_days
=
std
::
stoi
(
val
.
second
.
data
());
}
op
.
setMariaDBConnection
(
host
,
user
,
password
,
database_name
,
port
,
rotation
,
every_x_days
);
if
(
backend
==
PerSystSqlOperator
::
MARIADB
)
{
op
.
setMariaDBConnection
(
host
,
user
,
password
,
database_name
,
port
,
rotation
,
every_x_days
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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