diff --git a/configure.ac b/configure.ac index b743077890..4a42f4625e 100644 --- a/configure.ac +++ b/configure.ac @@ -1621,9 +1621,9 @@ if test "$CQL_CPPFLAGS" != "" ; then cat >> config.report << END Cassandra CQL: - CQL_VERSION: ${CQL_VERSION} - CQL_CPPFLAGS: ${CQL_CPPFLAGS} - CQL_LIBS: ${CQL_LIBS} + CQL_VERSION: ${CQL_VERSION} + CQL_CPPFLAGS: ${CQL_CPPFLAGS} + CQL_LIBS: ${CQL_LIBS} END else cat >> config.report << END diff --git a/src/lib/dhcpsrv/cql_host_data_source.cc b/src/lib/dhcpsrv/cql_host_data_source.cc index 6fab69ab02..5499848024 100644 --- a/src/lib/dhcpsrv/cql_host_data_source.cc +++ b/src/lib/dhcpsrv/cql_host_data_source.cc @@ -1339,7 +1339,7 @@ public: /// See @ref CqlHostDataSource::add() for parameter details. /// /// @param host host to be added or deleted - /// @param insert insert or delete the host + /// @param insert insert (true) or delete (false) the host virtual bool insertOrDelete(const HostPtr& host, bool insert); /// @brief Implementation of @ref CqlHostDataSource::get4() @@ -1974,7 +1974,8 @@ CqlHostDataSourceImpl::insertOrDeleteHostWithOptions(bool insert, } option_found = true; /// @todo: Assign actual value to subnet id. - result = insertOrDeleteHost(insert, host, OptionalValue(), reservation, space, option); + result = insertOrDeleteHost(insert, host, OptionalValue(), reservation, + space, option); } } } @@ -2082,17 +2083,14 @@ CqlHostDataSourceImpl::insertOrDeleteHost(bool insert, try { if (insert) { - host_exchange->createBindForMutation( - host, subnet_id, reservation, option_space, option_descriptor, - CqlHostExchange::INSERT_HOST, assigned_values); + host_exchange->createBindForMutation(host, subnet_id, reservation, option_space, + option_descriptor, CqlHostExchange::INSERT_HOST, assigned_values); host_exchange->executeMutation(dbconn_, assigned_values, CqlHostExchange::INSERT_HOST); } else { - host_exchange->createBindForDelete( - host, subnet_id, reservation, option_space, option_descriptor, - CqlHostExchange::DELETE_HOST, assigned_values); - + host_exchange->createBindForDelete(host, subnet_id, reservation, option_space, + option_descriptor, CqlHostExchange::DELETE_HOST, assigned_values); host_exchange->executeMutation(dbconn_, assigned_values, CqlHostExchange::DELETE_HOST); } @@ -2155,8 +2153,8 @@ CqlHostDataSource::del(const SubnetID& subnet_id, const asiolink::IOAddress& add bool CqlHostDataSource::del4(const SubnetID& subnet_id, const Host::IdentifierType& identifier_type, const uint8_t* identifier_begin, const size_t identifier_len) { - HostPtr host = boost::const_pointer_cast(impl_->get4( - subnet_id, identifier_type, identifier_begin, identifier_len)); + HostPtr host = boost::const_pointer_cast(impl_->get4(subnet_id, identifier_type, + identifier_begin, identifier_len)); return (impl_->insertOrDelete(host, false)); } @@ -2164,8 +2162,8 @@ CqlHostDataSource::del4(const SubnetID& subnet_id, const Host::IdentifierType& i bool CqlHostDataSource::del6(const SubnetID& subnet_id, const Host::IdentifierType& identifier_type, const uint8_t* identifier_begin, const size_t identifier_len) { - HostPtr host = boost::const_pointer_cast(impl_->get6( - subnet_id, identifier_type, identifier_begin, identifier_len)); + HostPtr host = boost::const_pointer_cast(impl_->get6(subnet_id, identifier_type, + identifier_begin, identifier_len)); return (impl_->insertOrDelete(host, false)); } diff --git a/src/lib/dhcpsrv/cql_host_data_source.h b/src/lib/dhcpsrv/cql_host_data_source.h index 08546f47bf..b2b45e4325 100644 --- a/src/lib/dhcpsrv/cql_host_data_source.h +++ b/src/lib/dhcpsrv/cql_host_data_source.h @@ -314,7 +314,9 @@ public: /// @brief Returns a collection of all the hosts. /// - /// This method may return multiple @ref Host objects. + /// This method may return multiple @ref Host objects. It is only used in + /// testing. It may be very slow when running on a production server with + /// lots of hosts. /// /// @return Collection of const @ref Host objects. virtual ConstHostCollection diff --git a/src/lib/dhcpsrv/tests/cql_host_data_source_unittest.cc b/src/lib/dhcpsrv/tests/cql_host_data_source_unittest.cc index 65275506a0..a3c1c0cd4c 100644 --- a/src/lib/dhcpsrv/tests/cql_host_data_source_unittest.cc +++ b/src/lib/dhcpsrv/tests/cql_host_data_source_unittest.cc @@ -281,6 +281,7 @@ TEST(CqlConnection, checkTimeConversion) { } // This test verifies that database backend can operate in Read-Only mode. +// We currently don't test Cassandra in read-only mode. TEST_F(CqlHostDataSourceTest, DISABLED_testReadOnlyDatabase) { testReadOnlyDatabase(CQL_VALID_TYPE); } diff --git a/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc index a93a96d6a1..3d6bf79fb8 100644 --- a/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2015-2017 Deutsche Telekom AG. // // Authors: Razvan Becheriu diff --git a/src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc index 67c34553cf..c2666fa3b6 100644 --- a/src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc @@ -442,12 +442,12 @@ TEST_F(PgSqlLeaseMgrTest, nullDuid) { testNullDuid(); } -/// @brief Tests whether memfile can store and retrieve hardware addresses +/// @brief Tests whether Postgres can store and retrieve hardware addresses TEST_F(PgSqlLeaseMgrTest, testLease6Mac) { testLease6MAC(); } -/// @brief Tests whether memfile can store and retrieve hardware addresses +/// @brief Tests whether Postgres can store and retrieve hardware addresses TEST_F(PgSqlLeaseMgrTest, testLease6HWTypeAndSource) { testLease6HWTypeAndSource(); }