% DHCPSRV_CQL_UPDATE_ADDR6 updating IPv6 lease for address %1
A debug message issued when the server is attempting to update IPv6
lease from the Cassandra database for the specified address.
-
-% TOMS_UTILITY_MESSAGE %1
-Handy log message that should be deleted
/// @brief Creates and runs the IPv4 lease stats query
///
/// It creates an instance of a MemfileLeaseStatsQuery4 and then
- /// invokes it's start method in which the query constructs its
+ /// invokes its start method in which the query constructs its
/// statistical data result set. The query object is then returned.
///
/// @return The populated query as a pointer to an LeaseStatsQuery
/// @brief Creates and runs the IPv6 lease stats query
///
/// It creates an instance of a MemfileLeaseStatsQuery6 and then
- /// invokes it's start method in which the query constructs its
+ /// invokes its start method in which the query constructs its
/// statistical data result set. The query object is then returned.
///
/// @return The populated query as a pointer to an LeaseStatsQuery.
MySqlLeaseStatsQuery(MySqlConnection& conn, const size_t statement_index,
const bool fetch_type)
: conn_(conn), statement_index_(statement_index), statement_(NULL),
- fetch_type_(fetch_type), bind_(fetch_type_ ? 4 : 3) {
+ fetch_type_(fetch_type),
+ // Set the number of columns in the bind array based on fetch_type
+ // This is the number of columns expected in the result set
+ bind_(fetch_type_ ? 4 : 3) {
if (statement_index_ >= MySqlLeaseMgr::NUM_STATEMENTS) {
isc_throw(BadValue, "MySqlLeaseStatsQuery"
" - invalid statement index" << statement_index_);
/// @brief Creates the IPv4 lease statistical data result set
///
- /// The result set is populated by executing an SQL query against the
- /// lease4 table which sums the leases per lease state per subnet id.
- /// The query used is the prepared statement identified by
- /// MySqlLeaseMgr::RECOUNT_LEASE4_STATS. This method creates the binds
- /// the statement to the output bind array and then executes the
- /// statement.
+ /// The result set is populated by executing a SQL query against the
+ /// lease(4/6) table which sums the leases per lease state per lease
+ /// type (v6 only) per subnet id. This method binds the statement to
+ /// the output bind array and then executes the statement, and fetches
+ /// entire result set.
void start() {
int col = 0;
// subnet_id: unsigned int
AllocEngine6Test::AllocEngine6Test() {
CfgMgr::instance().clear();
+ // This lease mgr needs to exist to before configuration commits.
factory_.create("type=memfile universe=6 persist=false");
duid_ = DuidPtr(new DUID(std::vector<uint8_t>(8, 0x42)));
AllocEngine4Test::AllocEngine4Test() {
+ // This lease mgr needs to exist to before configuration commits.
factory_.create("type=memfile universe=4 persist=false");
// Create fresh instance of the HostMgr, and drop any previous HostMgr state.
StatsMgr::instance().removeAll();
- // create subnets
- CfgSubnets4Ptr cfg =
- CfgMgr::instance().getStagingCfg()->getCfgSubnets4();
-
- // Create 3 subnets.
+ // Create two subnets.
+ int num_subnets = 2;
+ CfgSubnets4Ptr cfg = CfgMgr::instance().getStagingCfg()->getCfgSubnets4();
Subnet4Ptr subnet;
Pool4Ptr pool;
subnet->addPool(pool);
cfg->add(subnet);
- int num_subnets = 2;
ASSERT_NO_THROW(CfgMgr::instance().commit());
StatsMgr::instance().removeAll();
- // create subnets
- CfgSubnets6Ptr cfg =
- CfgMgr::instance().getStagingCfg()->getCfgSubnets6();
-
- // Create 3 subnets.
+ // Create two subnets.
+ int num_subnets = 2;
+ CfgSubnets6Ptr cfg = CfgMgr::instance().getStagingCfg()->getCfgSubnets6();
Subnet6Ptr subnet;
Pool6Ptr pool;
- int num_subnets = 2;
StatValMapList expectedStats(num_subnets);
int subnet_id = 1;
/// @brief Compares StatsMgr statistics against an expected list of values
///
- /// Iterates over a list of statistic names and expectec values, attempting
+ /// Iterates over a list of statistic names and expected values, attempting
/// to fetch each from the StatsMgr and if found, compare its observed value
- /// to the expected value. Fails any the stat is not found or if the values
- /// do not match.
+ /// to the expected value. Fails if any of the expected stats are not
+ /// found or if the values do not match.
///
/// @param expected_stats Map of expected static names and values.
void checkLeaseStats(const StatValMapList& expected_stats);