]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[github70] Changes after review:
authorTomek Mrugalski <tomasz@isc.org>
Mon, 12 Mar 2018 17:52:22 +0000 (17:52 +0000)
committerTomek Mrugalski <tomasz@isc.org>
Mon, 12 Mar 2018 17:52:22 +0000 (17:52 +0000)
 - comments added
 - line wraps tweaked a bit

configure.ac
src/lib/dhcpsrv/cql_host_data_source.cc
src/lib/dhcpsrv/cql_host_data_source.h
src/lib/dhcpsrv/tests/cql_host_data_source_unittest.cc
src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc
src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc

index b74307789016d516f15ee833b83b453759cd2468..4a42f4625ee4801ddd15141a9b245ae2e2a0bfe1 100644 (file)
@@ -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
index 6fab69ab020b860e7f8b9771a9f6cf3330e53d28..549984802454e06e3276de38eea14d6bdf7f03e8 100644 (file)
@@ -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<SubnetID>(), reservation, space, option);
+                result = insertOrDeleteHost(insert, host, OptionalValue<SubnetID>(), 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<Host>(impl_->get4(
-            subnet_id, identifier_type, identifier_begin, identifier_len));
+    HostPtr host = boost::const_pointer_cast<Host>(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<Host>(impl_->get6(
-            subnet_id, identifier_type, identifier_begin, identifier_len));
+    HostPtr host = boost::const_pointer_cast<Host>(impl_->get6(subnet_id, identifier_type,
+                                                               identifier_begin, identifier_len));
 
     return (impl_->insertOrDelete(host, false));
 }
index 08546f47bf490ff8febe3ba02ed1e13bd2453428..b2b45e432597da910b59bb81c6d3df41b2d3d3c4 100644 (file)
@@ -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
index 65275506a018799357eb2b73749f13fcfb1ef80b..a3c1c0cd4c52b72c3eed118fc6643ad1bade53b7 100644 (file)
@@ -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);
 }
index a93a96d6a1c41f474dc7f57e174f41d1a463d5b6..3d6bf79fb82e97023802ec3a3985c66eb4320aa6 100644 (file)
@@ -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 <razvan.becheriu@qualitance.com>
index 67c34553cf7cb027aa537f9efa09b09b3afbf3ca..c2666fa3b6bec51ef5d6de372b67afa5d05c4f6b 100644 (file)
@@ -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();
 }