From: Tomek Mrugalski Date: Fri, 22 Dec 2017 14:11:23 +0000 (+0100) Subject: [github35] Changes after first part of the review. X-Git-Tag: trac5494_base~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=161dc9c39722668a47d1627e063c686ff3562d94;p=thirdparty%2Fkea.git [github35] Changes after first part of the review. --- diff --git a/configure.ac b/configure.ac index 9fa181da52..012fac0f49 100644 --- a/configure.ac +++ b/configure.ac @@ -728,7 +728,7 @@ if test "$CQL_CONFIG" != "" ; then CQL_INCLUDEDIR=`$CQL_CONFIG --includedir` CQL_CPPFLAGS="`$CQL_CONFIG --cppflags` -I$CQL_INCLUDEDIR" - CQL_LIBS="-L`$CQL_CONFIG --libdir` -lcassandra_static -luv" + CQL_LIBS="-L`$CQL_CONFIG --libdir` -lcassandra -luv" CQL_VERSION=`$CQL_CONFIG --version` AC_SUBST(CQL_CPPFLAGS) diff --git a/src/bin/agent/Makefile.am b/src/bin/agent/Makefile.am index e67c5727af..6b346fb159 100644 --- a/src/bin/agent/Makefile.am +++ b/src/bin/agent/Makefile.am @@ -88,6 +88,9 @@ kea_ctrl_agent_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) kea_ctrl_agent_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) +if HAVE_CQL +kea_ctrl_agent_LDFLAGS += $(CQL_LIBS) +endif if GENERATE_PARSER diff --git a/src/hooks/dhcp/lease_cmds/tests/Makefile.am b/src/hooks/dhcp/lease_cmds/tests/Makefile.am index 0e987d2cd6..27a1096e95 100644 --- a/src/hooks/dhcp/lease_cmds/tests/Makefile.am +++ b/src/hooks/dhcp/lease_cmds/tests/Makefile.am @@ -53,5 +53,10 @@ lease_cmds_unittests_LDADD += $(LOG4CPLUS_LIBS) lease_cmds_unittests_LDADD += $(CRYPTO_LIBS) lease_cmds_unittests_LDADD += $(BOOST_LIBS) lease_cmds_unittests_LDADD += $(GTEST_LDADD) + +if HAVE_CQL +lease_cmds_unittests_LDFLAGS += $(CQL_LIBS) +endif + endif noinst_PROGRAMS = $(TESTS) diff --git a/src/lib/dhcpsrv/cql_exchange.cc b/src/lib/dhcpsrv/cql_exchange.cc index c6d72bca12..c45c4ec921 100644 --- a/src/lib/dhcpsrv/cql_exchange.cc +++ b/src/lib/dhcpsrv/cql_exchange.cc @@ -22,6 +22,20 @@ #include #include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + namespace isc { namespace dhcp { diff --git a/src/lib/dhcpsrv/cql_exchange.h b/src/lib/dhcpsrv/cql_exchange.h index 837fb01593..798d319957 100644 --- a/src/lib/dhcpsrv/cql_exchange.h +++ b/src/lib/dhcpsrv/cql_exchange.h @@ -48,7 +48,7 @@ class CqlExchange; /// behaviour. class AnyArray : public std::vector { public: - /// @brief Add a at the end of the vector. + /// @brief Add a value at the end of the vector. void add(const boost::any& value); /// @brief Remove the void pointer to the data value from a specified diff --git a/src/lib/dhcpsrv/db_exceptions.h b/src/lib/dhcpsrv/db_exceptions.h index e6d2eca287..efff251d0d 100644 --- a/src/lib/dhcpsrv/db_exceptions.h +++ b/src/lib/dhcpsrv/db_exceptions.h @@ -13,6 +13,10 @@ namespace isc { namespace dhcp { /// @brief Database statement not applied +/// +/// Cassandra have a concept of mutation (any statement that does change the +/// data, like INSERT, UPDATE or DELETE. Under certain conditions it may be +/// possible that those statesments may fail to apply. class StatementNotApplied : public Exception { public: StatementNotApplied(const char* file, size_t line, const char* what) diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.mes b/src/lib/dhcpsrv/dhcpsrv_messages.mes index 45b4afd3a4..22b66a5519 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.mes +++ b/src/lib/dhcpsrv/dhcpsrv_messages.mes @@ -198,9 +198,6 @@ the Cassandra database. The connection is closed as part of normal server shutdown. This error is most likely a programmatic issue that is highly unlikely to occur or negatively impact server operation. -% DHCPSRV_CQL_BEGIN_TRANSACTION begin transaction. -The server has issued a begin transaction call. - % DHCPSRV_CQL_CONNECTION_BEGIN_TRANSACTION begin transaction on current connection. The server has issued a begin transaction call. diff --git a/src/lib/dhcpsrv/sql_common.h b/src/lib/dhcpsrv/sql_common.h index 3521410658..610abd62e1 100644 --- a/src/lib/dhcpsrv/sql_common.h +++ b/src/lib/dhcpsrv/sql_common.h @@ -17,20 +17,6 @@ #ifndef SQL_COMMON_H #define SQL_COMMON_H -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - namespace isc { namespace dhcp { @@ -47,8 +33,8 @@ enum ExchangeDataType { EXCHANGE_DATA_TYPE_STRING, EXCHANGE_DATA_TYPE_BYTES, EXCHANGE_DATA_TYPE_UUID, - EXCHANGE_DATA_TYPE_UDT, - EXCHANGE_DATA_TYPE_COLLECTION + EXCHANGE_DATA_TYPE_UDT, ///< User-Defined Type (used in Cassandra) + EXCHANGE_DATA_TYPE_COLLECTION ///< Collection (used in Cassandra) }; /// @brief Base class for backend exchanges.