Kea  1.9.9-git
isc::dhcp::CqlHostDataSource Class Reference

Cassandra host data source. More...

#include <cql_host_data_source.h>

+ Inheritance diagram for isc::dhcp::CqlHostDataSource:

Public Member Functions

 CqlHostDataSource (const db::DatabaseConnection::ParameterMap &parameters)
 Constructor. More...
 
virtual ~CqlHostDataSource ()
 Virtual destructor. More...
 
virtual void add (const HostPtr &host) override
 Adds a new host to the collection. More...
 
virtual void commit () override
 Commit Transactions. More...
 
virtual bool del (const SubnetID &subnet_id, const asiolink::IOAddress &addr) override
 Attempts to delete hosts by (subnet-id, address) More...
 
virtual bool del4 (const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) override
 Attempts to delete a host by (subnet-id4, identifier-type, identifier). More...
 
virtual bool del6 (const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) override
 Attempts to delete a host by (subnet-id6, identifier-type, identifier). More...
 
virtual ConstHostPtr get4 (const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const override
 Retrieves a Host connected to an IPv4 subnet. More...
 
virtual ConstHostPtr get4 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const override
 Retrieves a Host connected to an IPv4 subnet. More...
 
virtual ConstHostPtr get6 (const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const override
 Returns a Host connected to an IPv6 subnet. More...
 
virtual ConstHostPtr get6 (const asiolink::IOAddress &prefix, const uint8_t prefix_len) const override
 Returns a Host with the specified reservation prefix. More...
 
virtual ConstHostPtr get6 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const override
 Returns a host connected to the IPv6 subnet and having a reservation for a specified IPv6 address or prefix. More...
 
virtual ConstHostCollection getAll (const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const override
 Return all hosts connected to any subnet for which reservations have been made using a specified identifier. More...
 
virtual ConstHostCollection getAll4 (const SubnetID &subnet_id) const override
 Return all hosts in a DHCPv4 subnet. More...
 
virtual ConstHostCollection getAll4 (const asiolink::IOAddress &address) const override
 Returns a collection of hosts using the specified IPv4 address. More...
 
virtual ConstHostCollection getAll4 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const override
 Returns all hosts connected to the IPv4 subnet and having a reservation for a specified address. More...
 
virtual ConstHostCollection getAll6 (const SubnetID &subnet_id) const override
 Return all hosts in a DHCPv6 subnet. More...
 
virtual ConstHostCollection getAll6 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const override
 Returns all hosts connected to the IPv6 subnet and having a reservation for a specified address or delegated prefix (lease). More...
 
virtual ConstHostCollection getAllbyHostname (const std::string &hostname) const override
 Return all hosts with a hostname. More...
 
virtual ConstHostCollection getAllbyHostname4 (const std::string &hostname, const SubnetID &subnet_id) const override
 Return all hosts with a hostname in a DHCPv4 subnet. More...
 
virtual ConstHostCollection getAllbyHostname6 (const std::string &hostname, const SubnetID &subnet_id) const override
 Return all hosts with a hostname in a DHCPv6 subnet. More...
 
virtual ConstHostCollection getAllHosts () const
 Returns a collection of all the hosts. More...
 
virtual std::string getDescription () const
 Returns textual description of the backend. More...
 
virtual std::string getName () const
 Returns the name of the database. More...
 
virtual ConstHostCollection getPage4 (const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const override
 Returns range of hosts in a DHCPv4 subnet. More...
 
virtual ConstHostCollection getPage4 (size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const override
 Returns range of hosts. More...
 
virtual ConstHostCollection getPage6 (const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const override
 Returns range of hosts in a DHCPv6 subnet. More...
 
virtual ConstHostCollection getPage6 (size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const override
 Returns range of hosts. More...
 
virtual std::string getType () const override
 Return backend type. More...
 
virtual db::VersionPair getVersion () const
 Retrieves schema version from the DB. More...
 
virtual void rollback () override
 Rollback Transactions. More...
 
virtual bool setIPReservationsUnique (const bool unique) override
 Controls whether IP reservations are unique or non-unique. More...
 
- Public Member Functions inherited from isc::dhcp::BaseHostDataSource
virtual ~BaseHostDataSource ()
 Default destructor implementation. More...
 
virtual isc::db::DatabaseConnection::ParameterMap getParameters () const
 Return backend parameters. More...
 
virtual bool isUnusable ()
 Flag which indicates if the host manager has at least one unusable connection. More...
 

Additional Inherited Members

- Public Types inherited from isc::dhcp::BaseHostDataSource
enum  IdType { ID_HWADDR = 0, ID_DUID = 1 }
 Specifies the type of an identifier. More...
 

Detailed Description

Cassandra host data source.

Implements isc::dhcp::BaseHostDataSource interface customized to Cassandra. Use of this backend implies that a Cassandra database is available and that the Kea schema has been created within it.

The database schema is radically different than the MySQL and the PostgreSQL schemas. Rather than creating a different table for hosts, reservations, DHCPv4 options and DHCPv6 options respectively, the data is denormalized into a single table to benefit from Cassandra's non-relational nature. To make up for the lack of relations, on insertion, the reservations and options are matched against hosts on the server and merged into database entries. When retrieving, each database row is split into the corresponding host, reservation and options.

There can be an inconsistency in the database due to the order of the changes e.g. if you insert a host with no reservations and no options followed by the same host with one reservation will result in 2 entries versus inserting the host with reservation from the beginning which will result in a single entry. In spite of this, retrieving the host will give you the attached reservation in both cases.

Definition at line 56 of file cql_host_data_source.h.

Constructor & Destructor Documentation

isc::dhcp::CqlHostDataSource::CqlHostDataSource ( const db::DatabaseConnection::ParameterMap parameters)
explicit

Constructor.

Uses the following keywords in the parameters passed to it to connect to the Cassandra cluster (if omitted, defaults specified in parentheses):

  • keyspace: name of the database to which to connect (keatest)
  • contact-points: IP addresses of the nodes to connect to (127.0.0.1)
  • consistency: consistency level (quorum)
  • serial-consistency: serial consistency level (serial)
  • port: The TCP port to use (9042)
  • user - credentials to use when connecting (no username)
  • password - credentials to use when connecting (no password)
  • reconnect-wait-time 2000
  • connect-timeout 5000
  • request-timeout 12000
  • tcp-keepalive no
  • tcp-nodelay no

For details regarding those parameters, see isc::db::CqlConnection::openDatabase.

Finally, all the CQL commands are pre-compiled.

Parameters
parametersa data structure relating keywords and values concerned with the database.
Exceptions
isc::db::NoDatabaseNameMandatory database name not given
isc::db::DbOpenErrorError opening the database or if the schema version is invalid.
isc::db::DbOperationErrorAn operation on the open database has failed.

Definition at line 3450 of file cql_host_data_source.cc.

isc::dhcp::CqlHostDataSource::~CqlHostDataSource ( )
virtual

Virtual destructor.

Releases prepared CQL statements used by the backend.

Definition at line 3454 of file cql_host_data_source.cc.

Member Function Documentation

void isc::dhcp::CqlHostDataSource::add ( const HostPtr host)
overridevirtual

Adds a new host to the collection.

The implementations of this method should guard against duplicate reservations for the same Host, where possible. For example, when the reservation for the same HWAddr and SubnetID is added twice, add() should throw a db::DuplicateEntry exception. Note, that usually it is impossible to guard against adding duplicated Host, where one instance is identified by different identifier types.

Parameters
hostpointer to the new Host being added.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3459 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_ADD, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::insertOrDelete(), and LOG_DEBUG.

+ Here is the call graph for this function:

void isc::dhcp::CqlHostDataSource::commit ( )
overridevirtual

Commit Transactions.

Commits all pending database operations (no-op for Cassandra)

Reimplemented from isc::dhcp::BaseHostDataSource.

Definition at line 3676 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_COMMIT, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, and LOG_DEBUG.

bool isc::dhcp::CqlHostDataSource::del ( const SubnetID subnet_id,
const asiolink::IOAddress addr 
)
overridevirtual

Attempts to delete hosts by (subnet-id, address)

This method supports both v4 and v6.

Parameters
subnet_idsubnet identifier.
addrspecified address.
Returns
true if deletion was successful, false if the host was not there.
Exceptions
variousexceptions in case of errors

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3466 of file cql_host_data_source.cc.

References isc::dhcp::CqlHostDataSourceImpl::get4(), and isc::dhcp::CqlHostDataSourceImpl::insertOrDelete().

+ Here is the call graph for this function:

bool isc::dhcp::CqlHostDataSource::del4 ( const SubnetID subnet_id,
const Host::IdentifierType identifier_type,
const uint8_t *  identifier_begin,
const size_t  identifier_len 
)
overridevirtual

Attempts to delete a host by (subnet-id4, identifier-type, identifier).

This method supports v4 hosts only.

Parameters
subnet_idIPv4 Subnet identifier.
identifier_typeIdentifier type.
identifier_beginPointer to a beginning of a buffer containing an identifier.
identifier_lenIdentifier length.
Returns
true if deletion was successful, false if the host was not there.
Exceptions
variousexceptions in case of errors

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3473 of file cql_host_data_source.cc.

References isc::dhcp::CqlHostDataSourceImpl::get4(), and isc::dhcp::CqlHostDataSourceImpl::insertOrDelete().

+ Here is the call graph for this function:

bool isc::dhcp::CqlHostDataSource::del6 ( const SubnetID subnet_id,
const Host::IdentifierType identifier_type,
const uint8_t *  identifier_begin,
const size_t  identifier_len 
)
overridevirtual

Attempts to delete a host by (subnet-id6, identifier-type, identifier).

This method supports v6 hosts only.

Parameters
subnet_idIPv6 Subnet identifier.
identifier_typeIdentifier type.
identifier_beginPointer to a beginning of a buffer containing an identifier.
identifier_lenIdentifier length.
Returns
true if deletion was successful, false if the host was not there.
Exceptions
variousexceptions in case of errors

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3482 of file cql_host_data_source.cc.

References isc::dhcp::CqlHostDataSourceImpl::get6(), and isc::dhcp::CqlHostDataSourceImpl::insertOrDelete().

+ Here is the call graph for this function:

ConstHostPtr isc::dhcp::CqlHostDataSource::get4 ( const SubnetID subnet_id,
const Host::IdentifierType identifier_type,
const uint8_t *  identifier_begin,
const size_t  identifier_len 
) const
overridevirtual

Retrieves a Host connected to an IPv4 subnet.

The host is identified by specific identifier.

Parameters
subnet_idsubnet identifier to filter by
identifier_typeidentifier type to filter by
identifier_beginpointer to the beginning of a buffer containing a host identifier to filter by
identifier_lenlength of the host identifier buffer
Returns
Host object for which a reservation has been made using the specified identifier

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3582 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET4, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::get4(), and LOG_DEBUG.

Referenced by getAll4().

+ Here is the call graph for this function:

ConstHostPtr isc::dhcp::CqlHostDataSource::get4 ( const SubnetID subnet_id,
const asiolink::IOAddress address 
) const
overridevirtual

Retrieves a Host connected to an IPv4 subnet.

The host is identifier by specified IPv4 address.

Parameters
subnet_idSubnet identifier.
addressreserved IPv4 address.
Returns
Const Host object
Exceptions
BadValueif address in not a valid IPv4address

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3593 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET4, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::get4(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostPtr isc::dhcp::CqlHostDataSource::get6 ( const SubnetID subnet_id,
const Host::IdentifierType identifier_type,
const uint8_t *  identifier_begin,
const size_t  identifier_len 
) const
overridevirtual

Returns a Host connected to an IPv6 subnet.

Parameters
subnet_idsubnet identifier to filter by
identifier_typeidentifier type to filter by
identifier_beginpointer to the beginning of a buffer containing a host identifier to filter by
identifier_lenlength of the host identifier buffer
Returns
Const Host object for which reservation has been made using the specified identifier.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3612 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET6, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::get6(), and LOG_DEBUG.

Referenced by getAll6().

+ Here is the call graph for this function:

ConstHostPtr isc::dhcp::CqlHostDataSource::get6 ( const asiolink::IOAddress prefix,
const uint8_t  prefix_len 
) const
overridevirtual

Returns a Host with the specified reservation prefix.

Parameters
prefixIPv6 prefix for which the Host object is searched.
prefix_lenIPv6 prefix length.
Returns
Const Host object using a specified IPv6 prefix.
Exceptions
MultipleRecordsif two or more rows are returned from the Cassandra database

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3622 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET6, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::get6(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostPtr isc::dhcp::CqlHostDataSource::get6 ( const SubnetID subnet_id,
const asiolink::IOAddress address 
) const
overridevirtual

Returns a host connected to the IPv6 subnet and having a reservation for a specified IPv6 address or prefix.

Parameters
subnet_idSubnet identifier.
addressreserved IPv6 address/prefix.
Returns
Const Host object using a specified IPv6 address/prefix.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3630 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET6, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::get6(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getAll ( const Host::IdentifierType identifier_type,
const uint8_t *  identifier_begin,
const size_t  identifier_len 
) const
overridevirtual

Return all hosts connected to any subnet for which reservations have been made using a specified identifier.

This method returns all Host objects which represent reservations for a specified identifier. This method may return multiple hosts because a particular client may have reservations in multiple subnets.

Parameters
identifier_typeIdentifier type.
identifier_beginPointer to a beginning of a buffer containing an identifier.
identifier_lenIdentifier length.
Returns
Collection of const Host objects.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3491 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET_ALL, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::getAll(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getAll4 ( const SubnetID subnet_id) const
overridevirtual

Return all hosts in a DHCPv4 subnet.

This method returns all Host objects which represent reservations in a specified subnet.

Parameters
subnet_idsubnet identifier to filter by
Returns
Collection of const Host objects.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3500 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET_ALL, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::getAll4(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getAll4 ( const asiolink::IOAddress address) const
overridevirtual

Returns a collection of hosts using the specified IPv4 address.

This method may return multiple Host objects if they are connected to different subnets.

Parameters
addressIPv4 address for which the Host object is searched.
Returns
Collection of const Host objects.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3575 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET_ALL, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::getAll4(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getAll4 ( const SubnetID subnet_id,
const asiolink::IOAddress address 
) const
overridevirtual

Returns all hosts connected to the IPv4 subnet and having a reservation for a specified address.

This backend does not support a configuration in which multiple reservations can be created for a single IPv4 address, so it always returns 1 or 0 hosts.

Parameters
subnet_idSubnet identifier.
addressreserved IPv4 address.
Returns
Collection of const Host objects.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3601 of file cql_host_data_source.cc.

References get4().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getAll6 ( const SubnetID subnet_id) const
overridevirtual

Return all hosts in a DHCPv6 subnet.

This method returns all Host objects which represent reservations in a specified subnet.

Parameters
subnet_idsubnet identifier to filter by
Returns
Collection of const Host objects.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3507 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET_ALL, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::getAll6(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getAll6 ( const SubnetID subnet_id,
const asiolink::IOAddress address 
) const
overridevirtual

Returns all hosts connected to the IPv6 subnet and having a reservation for a specified address or delegated prefix (lease).

This backend does not support a configuration in which multiple reservations can be created for a single IPv6 address, so it always returns 1 or 0 hosts.

Parameters
subnet_idSubnet identifier.
addressreserved IPv6 address.
Returns
Collection of const Host objects.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3638 of file cql_host_data_source.cc.

References get6().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getAllbyHostname ( const std::string &  hostname) const
overridevirtual

Return all hosts with a hostname.

This method returns all Host objects which represent reservations using a specified hostname.

Cassandra uses the new indexed lower_case_hostname column.

Parameters
hostnameThe lower case hostname.
Returns
Collection of const Host objects.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3514 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET_ALL, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::getAllbyHostname(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getAllbyHostname4 ( const std::string &  hostname,
const SubnetID subnet_id 
) const
overridevirtual

Return all hosts with a hostname in a DHCPv4 subnet.

This method returns all Host objects which represent reservations using a specified hostname in a specified subnet.

Parameters
hostnameThe lower case hostname.
subnet_idSubnet identifier.
Returns
Collection of const Host objects.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3521 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET_ALL, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::getAllbyHostname4(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getAllbyHostname6 ( const std::string &  hostname,
const SubnetID subnet_id 
) const
overridevirtual

Return all hosts with a hostname in a DHCPv6 subnet.

This method returns all Host objects which represent reservations using a specified hostname in a specified subnet.

Parameters
hostnameThe lower case hostname.
subnet_idSubnet identifier.
Returns
Collection of const Host objects.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3529 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET_ALL, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::getAllbyHostname6(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getAllHosts ( ) const
virtual

Returns a collection of all the hosts.

This method may return multiple Host objects. It is only used in testing. It may be very slow when running on a production server with lots of hosts.

Returns
Collection of const Host objects.

Definition at line 3649 of file cql_host_data_source.cc.

References isc::dhcp::CqlHostDataSourceImpl::getAllHosts().

+ Here is the call graph for this function:

std::string isc::dhcp::CqlHostDataSource::getDescription ( ) const
virtual

Returns textual description of the backend.

Returns
Description of the backend.

Definition at line 3664 of file cql_host_data_source.cc.

std::string isc::dhcp::CqlHostDataSource::getName ( ) const
virtual

Returns the name of the database.

Returns
database name

Definition at line 3659 of file cql_host_data_source.cc.

References isc::dhcp::CqlHostDataSourceImpl::getName().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getPage4 ( const SubnetID subnet_id,
size_t &  source_index,
uint64_t  lower_host_id,
const HostPageSize page_size 
) const
overridevirtual

Returns range of hosts in a DHCPv4 subnet.

Parameters
subnet_idSubnet identifier.
source_indexIndex of the source (unused).
lower_host_idHost identifier used as lower bound for the returned range.
page_sizemaximum size of the page returned.
Returns
Collection of const Host objects (may be empty).

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3537 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET_ALL, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::getPage4(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getPage4 ( size_t &  source_index,
uint64_t  lower_host_id,
const HostPageSize page_size 
) const
overridevirtual

Returns range of hosts.

Parameters
source_indexIndex of the source (unused).
lower_host_idHost identifier used as lower bound for the returned range.
page_sizemaximum size of the page returned.
Returns
Collection of const Host objects (may be empty).

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3557 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET_ALL, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::getPage4(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getPage6 ( const SubnetID subnet_id,
size_t &  source_index,
uint64_t  lower_host_id,
const HostPageSize page_size 
) const
overridevirtual

Returns range of hosts in a DHCPv6 subnet.

Parameters
subnet_idSubnet identifier.
source_indexIndex of the source (unused).
lower_host_idHost identifier used as lower bound for the returned range.
page_sizemaximum size of the page returned.
Returns
Collection of const Host objects (may be empty).

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3547 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET_ALL, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::getPage6(), and LOG_DEBUG.

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSource::getPage6 ( size_t &  source_index,
uint64_t  lower_host_id,
const HostPageSize page_size 
) const
overridevirtual

Returns range of hosts.

Parameters
source_indexIndex of the source (unused).
lower_host_idHost identifier used as lower bound for the returned range.
page_sizemaximum size of the page returned.
Returns
Collection of const Host objects (may be empty).

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3566 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_GET_ALL, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::getPage6(), and LOG_DEBUG.

+ Here is the call graph for this function:

std::string isc::dhcp::CqlHostDataSource::getType ( ) const
overridevirtual

Return backend type.

Returns
backend type "cql"

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3654 of file cql_host_data_source.cc.

VersionPair isc::dhcp::CqlHostDataSource::getVersion ( ) const
virtual

Retrieves schema version from the DB.

Returns
Version number stored in the database, as a pair of unsigned integers. "first" is the major version number, "second" is the minor version number.
Exceptions
isc::db::DbOperationErrorAn operation on the open database has failed.

Definition at line 3669 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_HOST_DB_GET_VERSION, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlHostDataSourceImpl::getVersion(), and LOG_DEBUG.

+ Here is the call graph for this function:

void isc::dhcp::CqlHostDataSource::rollback ( )
overridevirtual

Rollback Transactions.

Rolls back all pending database operations (no-op for Cassandra)

Reimplemented from isc::dhcp::BaseHostDataSource.

Definition at line 3681 of file cql_host_data_source.cc.

References isc::dhcp::DHCPSRV_CQL_ROLLBACK, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, and LOG_DEBUG.

bool isc::dhcp::CqlHostDataSource::setIPReservationsUnique ( const bool  unique)
overridevirtual

Controls whether IP reservations are unique or non-unique.

In a typical case, the IP reservations are unique and backends verify prior to adding a host reservation to the database that the reservation for a given IP address does not exist. In some cases it may be required to allow non-unique IP reservations, e.g. in the case when a host has several interfaces and independently of which interface is used by this host to communicate with the DHCP server the same IP address should be assigned. In this case the unique value should be set to false to disable the checks for uniqueness on the backend side.

Parameters
uniqueboolean flag indicating if the IP reservations must be unique within the subnet or can be non-unique.
Returns
true when addresses must be unique, false otherwise because this backend does not support specifying the same IP address in multiple host reservations.

Implements isc::dhcp::BaseHostDataSource.

Definition at line 3686 of file cql_host_data_source.cc.


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