Commit 1646cb29 authored by Razvan Becheriu's avatar Razvan Becheriu
Browse files

renamed parameter

parent 38b037be
......@@ -484,14 +484,14 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"cql-consistency\" {
\"consistency\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::LEASE_DATABASE:
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
case isc::dhcp::Parser4Context::CONFIG_DATABASE:
return isc::dhcp::Dhcp4Parser::make_CQL_CONSISTENCY(driver.loc_);
return isc::dhcp::Dhcp4Parser::make_CONSISTENCY(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("cql-consistency", driver.loc_);
return isc::dhcp::Dhcp4Parser::make_STRING("consistency", driver.loc_);
}
}
......
......@@ -90,7 +90,7 @@ using namespace std;
CONNECT_TIMEOUT "connect-timeout"
CONTACT_POINTS "contact-points"
KEYSPACE "keyspace"
CQL_CONSISTENCY "cql-consistency"
CONSISTENCY "consistency"
MAX_RECONNECT_TRIES "max-reconnect-tries"
RECONNECT_WAIT_TIME "reconnect-wait-time"
REQUEST_TIMEOUT "request-timeout"
......@@ -713,7 +713,7 @@ database_map_param: database_type
| tcp_keepalive
| tcp_nodelay
| keyspace
| cql_consistency
| consistency
| unknown_map_entry
;
......@@ -818,11 +818,11 @@ keyspace: KEYSPACE {
ctx.leave();
};
cql_consistency: CQL_CONSISTENCY {
consistency: CONSISTENCY {
ctx.enter(ctx.NO_KEYWORD);
} COLON STRING {
ElementPtr c(new StringElement($4, ctx.loc2pos(@4)));
ctx.stack_.back()->set("cql-consistency", c);
ctx.stack_.back()->set("consistency", c);
ctx.leave();
};
......
......@@ -679,14 +679,14 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"cql-consistency\" {
\"consistency\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::LEASE_DATABASE:
case isc::dhcp::Parser6Context::HOSTS_DATABASE:
case isc::dhcp::Parser6Context::CONFIG_DATABASE:
return isc::dhcp::Dhcp6Parser::make_CQL_CONSISTENCY(driver.loc_);
return isc::dhcp::Dhcp6Parser::make_CONSISTENCY(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("cql-consistency", driver.loc_);
return isc::dhcp::Dhcp6Parser::make_STRING("consistency", driver.loc_);
}
}
......
......@@ -77,7 +77,7 @@ using namespace std;
MAX_RECONNECT_TRIES "max-reconnect-tries"
RECONNECT_WAIT_TIME "reconnect-wait-time"
KEYSPACE "keyspace"
CQL_CONSISTENCY "cql-consistency"
CONSISTENCY "consistency"
REQUEST_TIMEOUT "request-timeout"
TCP_KEEPALIVE "tcp-keepalive"
TCP_NODELAY "tcp-nodelay"
......@@ -633,7 +633,7 @@ database_map_param: database_type
| tcp_keepalive
| tcp_nodelay
| keyspace
| cql_consistency
| consistency
| unknown_map_entry
;
......@@ -748,11 +748,11 @@ keyspace: KEYSPACE {
ctx.leave();
};
cql_consistency: CQL_CONSISTENCY {
consistency: CONSISTENCY {
ctx.enter(ctx.NO_KEYWORD);
} COLON STRING {
ElementPtr c(new StringElement($4, ctx.loc2pos(@4)));
ctx.stack_.back()->set("cql-consistency", c);
ctx.stack_.back()->set("consistency", c);
ctx.leave();
};
......
......@@ -76,17 +76,17 @@ CqlConnection::~CqlConnection() {
CassConsistency CqlConnection::parseConsistency(std::string value) {
static std::map<std::string, CassConsistency> consistency_map {
{"consistency-any", CASS_CONSISTENCY_ANY},
{"consistency-one", CASS_CONSISTENCY_ONE},
{"consistency-two", CASS_CONSISTENCY_TWO},
{"consistency-three", CASS_CONSISTENCY_THREE},
{"consistency-quorum", CASS_CONSISTENCY_QUORUM},
{"consistency-all", CASS_CONSISTENCY_ALL},
{"consistency-local-quorum", CASS_CONSISTENCY_LOCAL_QUORUM},
{"consistency-each-quorum", CASS_CONSISTENCY_EACH_QUORUM},
{"consistency-serial", CASS_CONSISTENCY_SERIAL},
{"consistency-local-serial", CASS_CONSISTENCY_LOCAL_SERIAL},
{"consistency-local-one", CASS_CONSISTENCY_LOCAL_ONE}
{"any", CASS_CONSISTENCY_ANY},
{"one", CASS_CONSISTENCY_ONE},
{"two", CASS_CONSISTENCY_TWO},
{"three", CASS_CONSISTENCY_THREE},
{"quorum", CASS_CONSISTENCY_QUORUM},
{"all", CASS_CONSISTENCY_ALL},
{"local-quorum", CASS_CONSISTENCY_LOCAL_QUORUM},
{"each-quorum", CASS_CONSISTENCY_EACH_QUORUM},
{"serial", CASS_CONSISTENCY_SERIAL},
{"local-serial", CASS_CONSISTENCY_LOCAL_SERIAL},
{"local-one", CASS_CONSISTENCY_LOCAL_ONE}
};
if (consistency_map.find(value) == consistency_map.end()) {
return CASS_CONSISTENCY_UNKNOWN;
......@@ -146,7 +146,7 @@ CqlConnection::openDatabase() {
const char* consistency = NULL;
std::string sconsistency;
try {
sconsistency = getParameter("cql-consistency");
sconsistency = getParameter("consistency");
consistency = sconsistency.c_str();
} catch (...) {
// No user. Fine, we'll use NULL.
......
......@@ -149,7 +149,7 @@ public:
/// - contact-points: IP addresses of the nodes to connect to (127.0.0.1)
/// - port: The TCP port to use (9042)
/// - user - credentials to use when connecting (no username)
/// - password - credentails to use when connecting (no password)
/// - password - credentials to use when connecting (no password)
/// - reconnect-wait-time 2000
/// - connect-timeout 5000
/// - request-timeout 12000
......
......@@ -194,7 +194,7 @@ DatabaseConnection::toElement(const ParameterMap& params) {
(keyword == "host") ||
(keyword == "name") ||
(keyword == "contact-points") ||
(keyword == "cql-consistency") ||
(keyword == "consistency") ||
(keyword == "keyspace")) {
result->set(keyword, isc::data::Element::create(value));
} else {
......
......@@ -109,7 +109,7 @@ DbAccessParser::parse(std::string& access_string,
// name
// contact-points
// keyspace
// cql-consistency
// consistency
values_copy[param.first] = param.second->stringValue();
}
} catch (const isc::data::TypeError& ex) {
......
......@@ -95,8 +95,8 @@ TEST_F(DatabaseConnectionCallbackTest, dbLostCallback) {
/// Create the connection..
DatabaseConnection datasrc(pmap);
/// We should be able to invoke the callback and glean
/// the correct reconnect contorl parameters from it.
/// We should be able to invoke the callback and get
/// the correct reconnect control parameters from it.
bool ret = false;
ASSERT_NO_THROW(ret = datasrc.invokeDbLostCallback());
EXPECT_TRUE(ret);
......@@ -260,6 +260,7 @@ TEST(DatabaseConnection, toElementDbAccessStringValid) {
"{\n"
"\"connect-timeout\" : 200, \n"
"\"contact-points\": \"contact_str\", \n"
"\"consistency\": \"quorum\", \n"
"\"host\": \"host_str\", \n"
"\"keyspace\": \"keyspace_str\", \n"
"\"lfc-interval\" : 100, \n"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment