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

Implementation of the CqlHostDataSource. More...

Public Member Functions

 CqlHostDataSourceImpl (const DatabaseConnection::ParameterMap &parameters)
 Constructor. More...
 
virtual ~CqlHostDataSourceImpl ()
 Destructor. More...
 
virtual ConstHostPtr get4 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const
 Implementation of CqlHostDataSource::get4() More...
 
virtual ConstHostPtr get4 (const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const
 Implementation of CqlHostDataSource::get4() More...
 
virtual ConstHostPtr get6 (const asiolink::IOAddress &prefix, const uint8_t prefix_len) const
 Retrieves a host by its reserved IPv6 address or prefix. More...
 
virtual ConstHostPtr get6 (const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const
 Implementation of CqlHostDataSource::get6() More...
 
virtual ConstHostPtr get6 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const
 Implementation of CqlHostDataSource::get6() More...
 
virtual ConstHostCollection getAll (const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const
 Implementation of CqlHostDataSource::getAll() More...
 
virtual ConstHostCollection getAll4 (const SubnetID &subnet_id) const
 Implementation of CqlHostDataSource::getAll4() More...
 
virtual ConstHostCollection getAll4 (const asiolink::IOAddress &address) const
 Implementation of CqlHostDataSource::getAll4() More...
 
virtual ConstHostCollection getAll6 (const SubnetID &subnet_id) const
 Implementation of CqlHostDataSource::getAll6() More...
 
virtual ConstHostCollection getAllbyHostname (const std::string &hostname) const
 Implementation of CqlHostDataSource::getAllbyHostname() More...
 
virtual ConstHostCollection getAllbyHostname4 (const std::string &hostname, const SubnetID &subnet_id) const
 Implementation of CqlHostDataSource::getAllbyHostname4() More...
 
virtual ConstHostCollection getAllbyHostname6 (const std::string &hostname, const SubnetID &subnet_id) const
 Implementation of CqlHostDataSource::getAllbyHostname6() More...
 
virtual ConstHostCollection getAllHosts () const
 Implementation of CqlHostDataSource::getAllHosts() More...
 
virtual std::string getName () const
 Implementation of CqlHostDataSource::getName() More...
 
virtual ConstHostCollection getPage4 (const SubnetID &subnet_id, uint64_t lower_host_id, const HostPageSize &page_size) const
 Implementation of CqlHostDataSource::getPage4() More...
 
virtual ConstHostCollection getPage4 (uint64_t lower_host_id, const HostPageSize &page_size) const
 Implementation of CqlHostDataSource::getPage4() More...
 
virtual ConstHostCollection getPage6 (const SubnetID &subnet_id, uint64_t lower_host_id, const HostPageSize &page_size) const
 Implementation of CqlHostDataSource::getPage6() More...
 
virtual ConstHostCollection getPage6 (uint64_t lower_host_id, const HostPageSize &page_size) const
 Implementation of CqlHostDataSource::getPage6() More...
 
virtual VersionPair getVersion () const
 Implementation of CqlHostDataSource::getVersion() More...
 
virtual bool insertOrDelete (const HostPtr &host, bool insert)
 Implementation of CqlHostDataSource::add() and del() More...
 

Protected Member Functions

virtual ConstHostPtr getHost (StatementTag statement_tag, AnyArray &where_values) const
 Retrieves a single host. More...
 
virtual ConstHostPtr getHostByKey (uint64_t key) const
 Retrieves a host by key. More...
 
virtual ConstHostCollection getHostCollection (StatementTag statement_tag, AnyArray &where_values) const
 Retrieves a collection of hosts. More...
 
virtual ConstHostCollection getHostCollectionPage4 (const SubnetID &subnet_id, uint64_t lower_host_id, size_t count=0) const
 Retrieves a page of hosts. More...
 
virtual ConstHostCollection getHostCollectionPage4 (uint64_t lower_host_id, size_t count=0) const
 Retrieves a page of hosts. More...
 
virtual ConstHostCollection getHostCollectionPage6 (const SubnetID &subnet_id, uint64_t lower_host_id, size_t count=0) const
 Retrieves a page of hosts. More...
 
virtual ConstHostCollection getHostCollectionPage6 (uint64_t lower_host_id, size_t count=0) const
 Retrieves a page of hosts. More...
 
virtual bool getHostKey (uint64_t lower_host_id, uint64_t &key) const
 Retrieves a valid host key. More...
 
virtual bool getHostKey4 (const SubnetID &subnet_id, uint64_t lower_host_id, uint64_t &key) const
 Retrieves a valid host key. More...
 
virtual bool getHostKey6 (const SubnetID &subnet_id, uint64_t lower_host_id, uint64_t &key) const
 Retrieves a valid host key. More...
 
virtual bool getNextHostKey (uint64_t &key) const
 Retrieves next valid host key. More...
 
virtual bool getNextHostKey4 (const SubnetID &subnet_id, uint64_t &key) const
 Retrieves next valid host key. More...
 
virtual bool getNextHostKey6 (const SubnetID &subnet_id, uint64_t &key) const
 Retrieves next valid host key. More...
 
virtual bool insertOrDeleteHost (bool insert, const HostPtr &host, const Optional< SubnetID > &subnet_id=Optional< SubnetID >(), const IPv6Resrv *const reservation=NULL, const std::string &option_space=NULL_OPTION_SPACE, const OptionDescriptor &option_descriptor=OptionDescriptor(false))
 Inserts or deletes a single host. More...
 
virtual bool insertOrDeleteHostWithOptions (bool insert, const HostPtr &host, const IPv6Resrv *const reservation=NULL, const std::list< std::string > &option_spaces=std::list< std::string >(), const ConstCfgOptionPtr cfg_option=ConstCfgOptionPtr())
 Adds/deletes any options found in the Host object to/from a separate table entry. More...
 
virtual bool insertOrDeleteHostWithReservations (bool insert, const HostPtr &host, const IPv6Resrv *const reservation, const std::list< std::string > &option_spaces4, const ConstCfgOptionPtr cfg_option4, const std::list< std::string > &option_spaces6, const ConstCfgOptionPtr cfg_option6)
 Adds/deletes any reservations found in the Host object to/from a separate table entry. More...
 
virtual void mergeHosts (const ConstHostPtr &source_host, HostPtr &target_host) const
 Merge denormalized table entries that belong to the same host into a single host, one by one. More...
 

Detailed Description

Implementation of the CqlHostDataSource.

This class is encapsulate all the Cassandra communication details.

Definition at line 2048 of file cql_host_data_source.cc.

Constructor & Destructor Documentation

isc::dhcp::CqlHostDataSourceImpl::CqlHostDataSourceImpl ( const DatabaseConnection::ParameterMap parameters)
explicit

Constructor.

This constructor opens database connection and initializes prepared statements used in the queries.

Parameters
parametersparameters passed to the CQL connection.

Definition at line 2512 of file cql_host_data_source.cc.

References isc::db::CQL_SCHEMA_VERSION_MAJOR, isc::db::CQL_SCHEMA_VERSION_MINOR, getVersion(), isc_throw, isc::db::CqlConnection::openDatabase(), and isc::db::CqlConnection::prepareStatements().

+ Here is the call graph for this function:

isc::dhcp::CqlHostDataSourceImpl::~CqlHostDataSourceImpl ( )
virtual

Destructor.

Definition at line 2532 of file cql_host_data_source.cc.

Member Function Documentation

ConstHostPtr isc::dhcp::CqlHostDataSourceImpl::get4 ( const SubnetID subnet_id,
const asiolink::IOAddress address 
) const
virtual

Implementation of CqlHostDataSource::get4()

See CqlHostDataSource::get4() for parameter details.

Parameters
subnet_idId of the subnet to look into
addressIPv4 address to be retrieved

Definition at line 2582 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), getHost(), isc_throw, isc::asiolink::IOAddress::isV4(), and isc::asiolink::IOAddress::toUint32().

Referenced by isc::dhcp::CqlHostDataSource::del(), isc::dhcp::CqlHostDataSource::del4(), and isc::dhcp::CqlHostDataSource::get4().

+ Here is the call graph for this function:

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

Implementation of CqlHostDataSource::get4()

See CqlHostDataSource::get4() for parameter details.

Parameters
subnet_idId of the subnet to look into
identifier_typetype of the identifier
identifier_beginpointer to the first byte of the identifier
identifier_lenlength of the identifier

Definition at line 2605 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), and getHost().

+ Here is the call graph for this function:

ConstHostPtr isc::dhcp::CqlHostDataSourceImpl::get6 ( const asiolink::IOAddress prefix,
const uint8_t  prefix_len 
) const
virtual

Retrieves a host by its reserved IPv6 address or prefix.

See CqlHostDataSource::get6() for parameter details.

Parameters
prefixIPv6 address or prefix
prefix_lenlength of the prefix (or 128 for address)

Definition at line 2628 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), getAll(), getHost(), isc_throw, and isc::asiolink::IOAddress::toText().

Referenced by isc::dhcp::CqlHostDataSource::del6(), and isc::dhcp::CqlHostDataSource::get6().

+ Here is the call graph for this function:

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

Implementation of CqlHostDataSource::get6()

See CqlHostDataSource::get6() for parameter details.

Parameters
subnet_idId of the subnet to look into
identifier_typetype of the identifier (duid, hwaddr, flex, etc.)
identifier_beginpointer to the first byte of the identifier
identifier_lenlength of the identifier

Definition at line 2671 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), and getHost().

+ Here is the call graph for this function:

ConstHostPtr isc::dhcp::CqlHostDataSourceImpl::get6 ( const SubnetID subnet_id,
const asiolink::IOAddress address 
) const
virtual

Implementation of CqlHostDataSource::get6()

See CqlHostDataSource::get6() for parameter details.

Parameters
subnet_idId of the subnet to look into
addressIPv6 address to be retrieved

Definition at line 2694 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), getHost(), and isc::asiolink::IOAddress::toText().

+ Here is the call graph for this function:

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

Implementation of CqlHostDataSource::getAll()

See CqlHostDataSource::getAll() for parameter details.

Parameters
identifier_typetype of the identifier (duid, hwaddr, flex, etc.)
identifier_beginpointer to the first byte of the identifier
identifier_lenlength of the identifier

Definition at line 2712 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), and getHostCollection().

Referenced by get6(), and isc::dhcp::CqlHostDataSource::getAll().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getAll4 ( const SubnetID subnet_id) const
virtual

Implementation of CqlHostDataSource::getAll4()

See CqlHostDataSource::getAll4() for parameter details.

Parameters
subnet_ididentifier of the subnet to which hosts belong

Definition at line 2732 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), and getHostCollection().

Referenced by isc::dhcp::CqlHostDataSource::getAll4().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getAll4 ( const asiolink::IOAddress address) const
virtual

Implementation of CqlHostDataSource::getAll4()

See CqlHostDataSource::getAll4() for parameter details.

Parameters
addressIPv4 address of the reservation to be retrieved

Definition at line 2872 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), getHostCollection(), and isc::asiolink::IOAddress::toUint32().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getAll6 ( const SubnetID subnet_id) const
virtual

Implementation of CqlHostDataSource::getAll6()

See CqlHostDataSource::getAll6() for parameter details.

Parameters
subnet_ididentifier of the subnet to which hosts belong

Definition at line 2749 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), and getHostCollection().

Referenced by isc::dhcp::CqlHostDataSource::getAll6().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getAllbyHostname ( const std::string &  hostname) const
virtual

Implementation of CqlHostDataSource::getAllbyHostname()

See CqlHostDataSource::getAllbyHostname() for parameter details.

Parameters
hostnameThe lower case hostname.

Definition at line 2766 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), and getHostCollection().

Referenced by isc::dhcp::CqlHostDataSource::getAllbyHostname().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getAllbyHostname4 ( const std::string &  hostname,
const SubnetID subnet_id 
) const
virtual

Implementation of CqlHostDataSource::getAllbyHostname4()

See CqlHostDataSource::getAllbyHostname4() for parameter details.

Parameters
hostnameThe lower case hostname.
subnet_idSubnet identifier.

Definition at line 2783 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), and getHostCollection().

Referenced by isc::dhcp::CqlHostDataSource::getAllbyHostname4().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getAllbyHostname6 ( const std::string &  hostname,
const SubnetID subnet_id 
) const
virtual

Implementation of CqlHostDataSource::getAllbyHostname6()

See CqlHostDataSource::getAllbyHostname6() for parameter details.

Parameters
hostnameThe lower case hostname.
subnet_idSubnet identifier.

Definition at line 2803 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), and getHostCollection().

Referenced by isc::dhcp::CqlHostDataSource::getAllbyHostname6().

+ Here is the call graph for this function:

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

Implementation of CqlHostDataSource::getAllHosts()

See CqlHostDataSource::getAllHosts() for parameter details.

Definition at line 2888 of file cql_host_data_source.cc.

References getHostCollection().

Referenced by isc::dhcp::CqlHostDataSource::getAllHosts().

+ Here is the call graph for this function:

ConstHostPtr isc::dhcp::CqlHostDataSourceImpl::getHost ( StatementTag  statement_tag,
AnyArray where_values 
) const
protectedvirtual

Retrieves a single host.

Calls getHostCollection() and checks if a single host was returned.

Parameters
where_valuesarray of bound objects used to filter the results
statement_tagprepared statement being executed
Returns
one host or a null pointer to a host
Exceptions
MultipleRecordsexception if two or more hosts are returned

Definition at line 2989 of file cql_host_data_source.cc.

References getHostCollection(), and isc_throw.

Referenced by get4(), and get6().

+ Here is the call graph for this function:

ConstHostPtr isc::dhcp::CqlHostDataSourceImpl::getHostByKey ( uint64_t  key) const
protectedvirtual

Retrieves a host by key.

Parameters
keyidentifier of the host
Returns
a host for the specific key

Definition at line 3048 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), getHostCollection(), and isc_throw.

Referenced by getHostCollectionPage4(), and getHostCollectionPage6().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getHostCollection ( StatementTag  statement_tag,
AnyArray where_values 
) const
protectedvirtual

Retrieves a collection of hosts.

Calls db::CqlExchange::executeSelect().

Parameters
where_valuesarray of bound objects used to filter the results
statement_tagprepared statement being executed
Returns
a collection of hosts containing one or more hosts

Definition at line 3007 of file cql_host_data_source.cc.

References isc::db::CqlExchange::executeSelect(), and mergeHosts().

Referenced by getAll(), getAll4(), getAll6(), getAllbyHostname(), getAllbyHostname4(), getAllbyHostname6(), getAllHosts(), getHost(), and getHostByKey().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getHostCollectionPage4 ( const SubnetID subnet_id,
uint64_t  lower_host_id,
size_t  count = 0 
) const
protectedvirtual

Retrieves a page of hosts.

Parameters
subnet_ididentifier of the subnet to which hosts belong
lower_host_idHost identifier used as lower bound for the returned range.
countthe size of the page
Returns
a collection of hosts containing one or more hosts

Definition at line 3073 of file cql_host_data_source.cc.

References getHostByKey(), and getHostKey4().

Referenced by getPage4().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getHostCollectionPage4 ( uint64_t  lower_host_id,
size_t  count = 0 
) const
protectedvirtual

Retrieves a page of hosts.

Parameters
lower_host_idHost identifier used as lower bound for the returned range.
countthe size of the page
Returns
a collection of hosts containing one or more hosts

Definition at line 3115 of file cql_host_data_source.cc.

References getHostByKey(), and getHostKey().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getHostCollectionPage6 ( const SubnetID subnet_id,
uint64_t  lower_host_id,
size_t  count = 0 
) const
protectedvirtual

Retrieves a page of hosts.

Parameters
subnet_ididentifier of the subnet to which hosts belong
lower_host_idHost identifier used as lower bound for the returned range.
countthe size of the page
Returns
a collection of hosts containing one or more hosts

Definition at line 3094 of file cql_host_data_source.cc.

References getHostByKey(), and getHostKey6().

Referenced by getPage6().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getHostCollectionPage6 ( uint64_t  lower_host_id,
size_t  count = 0 
) const
protectedvirtual

Retrieves a page of hosts.

Parameters
lower_host_idHost identifier used as lower bound for the returned range.
countthe size of the page
Returns
a collection of hosts containing one or more hosts

Definition at line 3135 of file cql_host_data_source.cc.

References getHostByKey(), and getHostKey().

+ Here is the call graph for this function:

bool isc::dhcp::CqlHostDataSourceImpl::getHostKey ( uint64_t  lower_host_id,
uint64_t &  key 
) const
protectedvirtual

Retrieves a valid host key.

if lower_host_id is 0 the key parameter will be updated with the key of the first host if lower_host_id is not 0 the key parameter will be updated with the next valid host key

Parameters
lower_host_idHost identifier used as lower bound for the returned range.
keyidentifier of the host which will be updated
Returns
true if there is such a host

Definition at line 3255 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), isc::db::CqlExchange::executeSelect(), getNextHostKey(), and isc::dhcp::CqlHostExchange::hashIntoKey().

Referenced by getHostCollectionPage4(), and getHostCollectionPage6().

+ Here is the call graph for this function:

bool isc::dhcp::CqlHostDataSourceImpl::getHostKey4 ( const SubnetID subnet_id,
uint64_t  lower_host_id,
uint64_t &  key 
) const
protectedvirtual

Retrieves a valid host key.

if lower_host_id is 0 the key parameter will be updated with the key of the first host if lower_host_id is not 0 the key parameter will be updated with the next valid host key

Parameters
subnet_ididentifier of the subnet to which hosts belong
lower_host_idHost identifier used as lower bound for the returned range.
keyidentifier of the host which will be updated
Returns
true if there is such a host

Definition at line 3155 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), isc::db::CqlExchange::executeSelect(), getNextHostKey4(), and isc::dhcp::CqlHostExchange::hashIntoKey().

Referenced by getHostCollectionPage4().

+ Here is the call graph for this function:

bool isc::dhcp::CqlHostDataSourceImpl::getHostKey6 ( const SubnetID subnet_id,
uint64_t  lower_host_id,
uint64_t &  key 
) const
protectedvirtual

Retrieves a valid host key.

if lower_host_id is 0 the key parameter will be updated with the key of the first host if lower_host_id is not 0 the key parameter will be updated with the next valid host key

Parameters
subnet_ididentifier of the subnet to which hosts belong
lower_host_idHost identifier used as lower bound for the returned range.
keyidentifier of the host which will be updated
Returns
true if there is such a host

Definition at line 3205 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), isc::db::CqlExchange::executeSelect(), getNextHostKey6(), and isc::dhcp::CqlHostExchange::hashIntoKey().

Referenced by getHostCollectionPage6().

+ Here is the call graph for this function:

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

Implementation of CqlHostDataSource::getName()

Definition at line 2900 of file cql_host_data_source.cc.

References isc::db::DatabaseConnection::getParameter().

Referenced by isc::dhcp::CqlHostDataSource::getName().

+ Here is the call graph for this function:

bool isc::dhcp::CqlHostDataSourceImpl::getNextHostKey ( uint64_t &  key) const
protectedvirtual

Retrieves next valid host key.

Parameters
keyidentifier of the host which will be updated with the next valid host key
Returns
true if there is such a host

Definition at line 3361 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), isc::db::CqlExchange::executeSelect(), and isc::dhcp::CqlHostExchange::hashIntoKey().

Referenced by getHostKey().

+ Here is the call graph for this function:

bool isc::dhcp::CqlHostDataSourceImpl::getNextHostKey4 ( const SubnetID subnet_id,
uint64_t &  key 
) const
protectedvirtual

Retrieves next valid host key.

Parameters
subnet_ididentifier of the subnet to which hosts belong
keyidentifier of the host which will be updated with the next valid host key
Returns
true if there is such a host

Definition at line 3299 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), isc::db::CqlExchange::executeSelect(), and isc::dhcp::CqlHostExchange::hashIntoKey().

Referenced by getHostKey4().

+ Here is the call graph for this function:

bool isc::dhcp::CqlHostDataSourceImpl::getNextHostKey6 ( const SubnetID subnet_id,
uint64_t &  key 
) const
protectedvirtual

Retrieves next valid host key.

Parameters
subnet_ididentifier of the subnet to which hosts belong
keyidentifier of the host which will be updated with the next valid host key
Returns
true if there is such a host

Definition at line 3330 of file cql_host_data_source.cc.

References isc::db::AnyArray::add(), isc::db::CqlExchange::executeSelect(), and isc::dhcp::CqlHostExchange::hashIntoKey().

Referenced by getHostKey6().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getPage4 ( const SubnetID subnet_id,
uint64_t  lower_host_id,
const HostPageSize page_size 
) const
virtual

Implementation of CqlHostDataSource::getPage4()

See CqlHostDataSource::getPage4() for parameter details.

Parameters
subnet_ididentifier of the subnet to which hosts belong
lower_host_idHost identifier used as lower bound for the returned range.
page_sizemaximum size of the page returned.

Definition at line 2830 of file cql_host_data_source.cc.

References getHostCollectionPage4(), and isc::dhcp::HostPageSize::page_size_.

Referenced by isc::dhcp::CqlHostDataSource::getPage4().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getPage4 ( uint64_t  lower_host_id,
const HostPageSize page_size 
) const
virtual

Implementation of CqlHostDataSource::getPage4()

See CqlHostDataSource::getPage4() for parameter details.

Parameters
lower_host_idHost identifier used as lower bound for the returned range.
page_sizemaximum size of the page returned.

Definition at line 2852 of file cql_host_data_source.cc.

References getHostCollectionPage4(), and isc::dhcp::HostPageSize::page_size_.

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getPage6 ( const SubnetID subnet_id,
uint64_t  lower_host_id,
const HostPageSize page_size 
) const
virtual

Implementation of CqlHostDataSource::getPage6()

See CqlHostDataSource::getPage6() for parameter details.

Parameters
subnet_ididentifier of the subnet to which hosts belong
lower_host_idHost identifier used as lower bound for the returned range.
page_sizemaximum size of the page returned.

Definition at line 2841 of file cql_host_data_source.cc.

References getHostCollectionPage6(), and isc::dhcp::HostPageSize::page_size_.

Referenced by isc::dhcp::CqlHostDataSource::getPage6().

+ Here is the call graph for this function:

ConstHostCollection isc::dhcp::CqlHostDataSourceImpl::getPage6 ( uint64_t  lower_host_id,
const HostPageSize page_size 
) const
virtual

Implementation of CqlHostDataSource::getPage6()

See CqlHostDataSource::getPage6() for parameter details.

Parameters
lower_host_idHost identifier used as lower bound for the returned range.
page_sizemaximum size of the page returned.

Definition at line 2862 of file cql_host_data_source.cc.

References getHostCollectionPage6(), and isc::dhcp::HostPageSize::page_size_.

+ Here is the call graph for this function:

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

Implementation of CqlHostDataSource::getVersion()

Definition at line 2911 of file cql_host_data_source.cc.

References isc::db::CqlConnection::getVersion().

Referenced by CqlHostDataSourceImpl(), and isc::dhcp::CqlHostDataSource::getVersion().

+ Here is the call graph for this function:

bool isc::dhcp::CqlHostDataSourceImpl::insertOrDelete ( const HostPtr host,
bool  insert 
)
virtual

Implementation of CqlHostDataSource::add() and del()

See CqlHostDataSource::add() for parameter details.

Parameters
hosthost to be added or deleted
insertinsert (true) or delete (false) the host

Definition at line 2538 of file cql_host_data_source.cc.

References insertOrDeleteHostWithReservations().

Referenced by isc::dhcp::CqlHostDataSource::add(), isc::dhcp::CqlHostDataSource::del(), isc::dhcp::CqlHostDataSource::del4(), and isc::dhcp::CqlHostDataSource::del6().

+ Here is the call graph for this function:

bool isc::dhcp::CqlHostDataSourceImpl::insertOrDeleteHost ( bool  insert,
const HostPtr host,
const Optional< SubnetID > &  subnet_id = Optional<SubnetID>(),
const IPv6Resrv *const  reservation = NULL,
const std::string &  option_space = NULL_OPTION_SPACE,
const OptionDescriptor option_descriptor = OptionDescriptor(false) 
)
protectedvirtual

Inserts or deletes a single host.

All information is available here. Calls db::CqlExchange::executeMutation().

Parameters
insertinsert or delete a host
hostHost object from which options are retrieved and inserted/deleted into/from the Cassandra database
subnet_ididentifier of the subnet to which the host belongs
reservationreservation for the current denormalized table entry
option_spaceoption space for the current denormalized table entry's option
option_descriptoroption descriptor containing information for the current denormalized table entry's option

Definition at line 3389 of file cql_host_data_source.cc.

References isc::dhcp::CqlHostExchange::createBindForDelete(), isc::dhcp::CqlHostExchange::createBindForMutation(), isc::db::CqlExchange::executeMutation(), isc_throw, and isc::Exception::what().

Referenced by insertOrDeleteHostWithOptions().

+ Here is the call graph for this function:

bool isc::dhcp::CqlHostDataSourceImpl::insertOrDeleteHostWithOptions ( bool  insert,
const HostPtr host,
const IPv6Resrv *const  reservation = NULL,
const std::list< std::string > &  option_spaces = std::list<std::string>(),
const ConstCfgOptionPtr  cfg_option = ConstCfgOptionPtr() 
)
protectedvirtual

Adds/deletes any options found in the Host object to/from a separate table entry.

Parameters
insertinsert or delete a host with options
hostHost object from which options are retrieved and inserted/deleted into/from the Cassandra database
reservationreservation for the current denormalized table entry
option_spaceslist of option spaces to search for
cfg_optionoption configuration used to match option spaces in order to obtain actual options
Todo:
: Assign actual value to subnet id.

Definition at line 2916 of file cql_host_data_source.cc.

References insertOrDeleteHost().

Referenced by insertOrDeleteHostWithReservations().

+ Here is the call graph for this function:

bool isc::dhcp::CqlHostDataSourceImpl::insertOrDeleteHostWithReservations ( bool  insert,
const HostPtr host,
const IPv6Resrv *const  reservation,
const std::list< std::string > &  option_spaces4,
const ConstCfgOptionPtr  cfg_option4,
const std::list< std::string > &  option_spaces6,
const ConstCfgOptionPtr  cfg_option6 
)
protectedvirtual

Adds/deletes any reservations found in the Host object to/from a separate table entry.

Parameters
insertinsert or deletes a host with reservations
hostHost object from which reservations are retrieved and inserted/deleted into/from the Cassandra database
reservationreservation for the current denormalized table entry
option_spaces4list of option spaces for universe Option::V4 to search in
cfg_option4option configuration for universe Option::V4 used to match option spaces in order to obtain actual options
option_spaces6list of option spaces for universe Option::V6 to search in
cfg_option6option configuration for universe Option::V6 used to match option spaces in order to obtain actual options

Definition at line 2957 of file cql_host_data_source.cc.

References insertOrDeleteHostWithOptions().

Referenced by insertOrDelete().

+ Here is the call graph for this function:

void isc::dhcp::CqlHostDataSourceImpl::mergeHosts ( const ConstHostPtr source_host,
HostPtr target_host 
) const
protectedvirtual

Merge denormalized table entries that belong to the same host into a single host, one by one.

Parameters
target_hosthost which can contain multiple reservations and options to which other distinct reservations and options are added.
source_hosthost that is being search for new reservations and options that will be merged into the old host.

Definition at line 3428 of file cql_host_data_source.cc.

Referenced by getHostCollection().


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