Kea: isc::dhcp::MemfileLeaseStatsQuery6 Class Reference

| Kea 3.0.2-git

isc::dhcp::MemfileLeaseStatsQuery6 Class Reference

Memfile derivation of the IPv6 statistical lease data query. More...

Inheritance diagram for isc::dhcp::MemfileLeaseStatsQuery6:
[legend]

## Public Member Functions
| MemfileLeaseStatsQuery6 (Lease6Storage &storage6, const SelectMode &select_mode=ALL_SUBNETS)
| Constructor.
| MemfileLeaseStatsQuery6 (Lease6Storage &storage6, const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
| Constructor for a subnet range query.
| MemfileLeaseStatsQuery6 (Lease6Storage &storage6, const SubnetID &subnet_id)
| Constructor for a single subnet query.
virtual | ~MemfileLeaseStatsQuery6 ()
| Destructor.
void | start ()
| Creates the IPv6 lease statistical data result set.
Public Member Functions inherited from isc::dhcp::MemfileLeaseStatsQuery
| MemfileLeaseStatsQuery (const SelectMode &select_mode=ALL_SUBNETS)
| Constructor for all subnets query.
| MemfileLeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
| Constructor for subnet range query.
| MemfileLeaseStatsQuery (const SubnetID &subnet_id)
| Constructor for single subnet query.
virtual | ~MemfileLeaseStatsQuery ()
| Destructor.
virtual bool | getNextRow (LeaseStatsRow &row)
| Fetches the next row in the result set.
int | getRowCount () const
| Returns the number of rows in the result set.
Public Member Functions inherited from isc::dhcp::LeaseStatsQuery
| LeaseStatsQuery (const SelectMode &select_mode=ALL_SUBNETS)
| Constructor to query statistics for all subnets.
| LeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
| Constructor to query for the stats for a range of subnets.
| LeaseStatsQuery (const SubnetID &subnet_id)
| Constructor to query for a single subnet's stats.
virtual | ~LeaseStatsQuery ()
| virtual destructor
SubnetID | getFirstSubnetID () const
| Returns the value of first subnet ID specified (or zero).
SubnetID | getLastSubnetID () const
| Returns the value of last subnet ID specified (or zero).
SelectMode | getSelectMode () const
| Returns the selection criteria mode The value returned is based upon the constructor variant used and it indicates which query variant will be executed.

## Additional Inherited Members
Public Types inherited from isc::dhcp::LeaseStatsQuery
enum | SelectMode { ALL_SUBNETS , SINGLE_SUBNET , SUBNET_RANGE , ALL_SUBNET_POOLS }
| Defines the types of selection criteria supported. More...
Protected Attributes inherited from isc::dhcp::MemfileLeaseStatsQuery
std::vector< LeaseStatsRow >::iterator | next_pos_
| An iterator for accessing the next row within the result set.
std::vector< LeaseStatsRow > | rows_
| A vector containing the "result set".
Protected Attributes inherited from isc::dhcp::LeaseStatsQuery
SubnetID | first_subnet_id_
| First (or only) subnet_id in the selection criteria.
SubnetID | last_subnet_id_
| Last subnet_id in the selection criteria when a range is given.

## Detailed Description

Memfile derivation of the IPv6 statistical lease data query.

This class is used to recalculate IPv6 lease statistics for Memfile lease storage. It does so by iterating over the given storage, accumulating counts of leases in each of the monitored lease states for each subnet and storing these counts in an internal collection. The populated result set will contain one entry per monitored state per subnet.

Definition at line 628 of file memfile_lease_mgr.cc.

## Constructor & Destructor Documentation

## ◆ MemfileLeaseStatsQuery6() [1/3]

isc::dhcp::MemfileLeaseStatsQuery6::MemfileLeaseStatsQuery6 | ( | Lease6Storage & | storage6,
|  | const SelectMode & | select_mode = ALL_SUBNETS )
| inline

Constructor.

Parameters

  storage6 | A pointer to the v6 lease storage to be counted
  select_mode | The selection criteria which is either ALL_SUBNETS or ALL_SUBNET_POOLS

Definition at line 635 of file memfile_lease_mgr.cc.

References isc::dhcp::MemfileLeaseStatsQuery::MemfileLeaseStatsQuery(), and isc::dhcp::LeaseStatsQuery::ALL_SUBNETS.

Here is the call graph for this function:

## ◆ MemfileLeaseStatsQuery6() [2/3]

isc::dhcp::MemfileLeaseStatsQuery6::MemfileLeaseStatsQuery6 | ( | Lease6Storage & | storage6,
|  | const SubnetID & | subnet_id )
| inline

Constructor for a single subnet query.

Parameters

  storage6 | A pointer to the v6 lease storage to be counted
  subnet_id | ID of the desired subnet

Definition at line 644 of file memfile_lease_mgr.cc.

References isc::dhcp::MemfileLeaseStatsQuery::MemfileLeaseStatsQuery().

Here is the call graph for this function:

## ◆ MemfileLeaseStatsQuery6() [3/3]

isc::dhcp::MemfileLeaseStatsQuery6::MemfileLeaseStatsQuery6 | ( | Lease6Storage & | storage6,
|  | const SubnetID & | first_subnet_id,
|  | const SubnetID & | last_subnet_id )
| inline

Constructor for a subnet range query.

Parameters

  storage6 | A pointer to the v6 lease storage to be counted
  first_subnet_id | ID of the first subnet in the desired range
  last_subnet_id | ID of the last subnet in the desired range

Definition at line 653 of file memfile_lease_mgr.cc.

References isc::dhcp::MemfileLeaseStatsQuery::MemfileLeaseStatsQuery().

Here is the call graph for this function:

## ◆ ~MemfileLeaseStatsQuery6()

virtual isc::dhcp::MemfileLeaseStatsQuery6::~MemfileLeaseStatsQuery6 | ( |  | ) |
| inlinevirtual

Destructor.

Definition at line 659 of file memfile_lease_mgr.cc.

## Member Function Documentation

## ◆ start()

void isc::dhcp::MemfileLeaseStatsQuery6::start | ( |  | ) |
| inlinevirtual

Creates the IPv6 lease statistical data result set.

The result set is populated by iterating over the IPv6 leases in storage, in ascending order by subnet id or by subnet id and pool id, accumulating the lease state counts per subnet or per subnet and pool. At the completion of all entries for a given subnet or pool, the counts are used to create LeaseStatsRow instances which are appended to an internal vector. The process results in a vector containing one entry per state per subnet or per subnet and pool.

Currently the states counted are:

- Lease::STATE_DEFAULT (i.e. assigned)
- Lease::STATE_DECLINED
- Lease::STATE_REGISTERED

Reimplemented from isc::dhcp::LeaseStatsQuery.

Definition at line 676 of file memfile_lease_mgr.cc.

References isc::dhcp::LeaseStatsQuery::ALL_SUBNET_POOLS, isc::dhcp::LeaseStatsQuery::ALL_SUBNETS, isc::dhcp::LeaseStatsQuery::getSelectMode(), isc::dhcp::LeaseStatsQuery::SINGLE_SUBNET, and isc::dhcp::LeaseStatsQuery::SUBNET_RANGE.

Here is the call graph for this function:

The documentation for this class was generated from the following file:

- memfile_lease_mgr.cc