void
MySqlHostDataSourceImpl::addResv(const IPv6Resrv& resv,
const HostID& id) {
- std::shared_ptr<MySqlIPv6ReservationExchange> host_ipv6_reservation_exchange(
+ thread_local std::shared_ptr<MySqlIPv6ReservationExchange> host_ipv6_reservation_exchange(
std::make_shared<MySqlIPv6ReservationExchange>());
std::vector<MYSQL_BIND> bind =
const std::string& opt_space,
const Optional<SubnetID>& subnet_id,
const HostID& id) {
- std::shared_ptr<MySqlOptionExchange> host_option_exchange(
+ thread_local std::shared_ptr<MySqlOptionExchange> host_option_exchange(
std::make_shared<MySqlOptionExchange>());
std::vector<MYSQL_BIND> bind =
// If operating in read-only mode, throw exception.
impl_->checkReadOnly();
- std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
+ thread_local std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
std::make_shared<MySqlHostWithOptionsExchange>(MySqlHostWithOptionsExchange::DHCP4_ONLY));
// Initiate MySQL transaction as we will have to make multiple queries
MySqlHostDataSource::getAll(const Host::IdentifierType& identifier_type,
const uint8_t* identifier_begin,
const size_t identifier_len) const {
- std::shared_ptr<MySqlHostIPv6Exchange> host_ipv46_exchange(
+ thread_local std::shared_ptr<MySqlHostIPv6Exchange> host_ipv46_exchange(
std::make_shared<MySqlHostIPv6Exchange>(MySqlHostWithOptionsExchange::DHCP4_AND_DHCP6));
// Set up the WHERE clause value
ConstHostCollection
MySqlHostDataSource::getAll4(const SubnetID& subnet_id) const {
- std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
+ thread_local std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
std::make_shared<MySqlHostWithOptionsExchange>(MySqlHostWithOptionsExchange::DHCP4_ONLY));
// Set up the WHERE clause value
ConstHostCollection
MySqlHostDataSource::getAll6(const SubnetID& subnet_id) const {
- std::shared_ptr<MySqlHostIPv6Exchange> host_ipv6_exchange(
+ thread_local std::shared_ptr<MySqlHostIPv6Exchange> host_ipv6_exchange(
std::make_shared<MySqlHostIPv6Exchange>(MySqlHostWithOptionsExchange::DHCP6_ONLY));
// Set up the WHERE clause value
ConstHostCollection
MySqlHostDataSource::getAllbyHostname(const std::string& hostname) const {
- std::shared_ptr<MySqlHostIPv6Exchange> host_ipv46_exchange(
+ thread_local std::shared_ptr<MySqlHostIPv6Exchange> host_ipv46_exchange(
std::make_shared<MySqlHostIPv6Exchange>(MySqlHostWithOptionsExchange::DHCP4_AND_DHCP6));
// Set up the WHERE clause value
ConstHostCollection
MySqlHostDataSource::getAllbyHostname4(const std::string& hostname,
const SubnetID& subnet_id) const {
- std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
+ thread_local std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
std::make_shared<MySqlHostWithOptionsExchange>(MySqlHostWithOptionsExchange::DHCP4_ONLY));
// Set up the WHERE clause value
ConstHostCollection
MySqlHostDataSource::getAllbyHostname6(const std::string& hostname,
const SubnetID& subnet_id) const {
- std::shared_ptr<MySqlHostIPv6Exchange> host_ipv6_exchange(
+ thread_local std::shared_ptr<MySqlHostIPv6Exchange> host_ipv6_exchange(
std::make_shared<MySqlHostIPv6Exchange>(MySqlHostWithOptionsExchange::DHCP6_ONLY));
// Set up the WHERE clause value
size_t& /*source_index*/,
uint64_t lower_host_id,
const HostPageSize& page_size) const {
- std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
+ thread_local std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
std::make_shared<MySqlHostWithOptionsExchange>(MySqlHostWithOptionsExchange::DHCP4_ONLY));
// Set up the WHERE clause value
size_t& /*source_index*/,
uint64_t lower_host_id,
const HostPageSize& page_size) const {
- std::shared_ptr<MySqlHostIPv6Exchange> host_ipv6_exchange(
+ thread_local std::shared_ptr<MySqlHostIPv6Exchange> host_ipv6_exchange(
std::make_shared<MySqlHostIPv6Exchange>(MySqlHostWithOptionsExchange::DHCP6_ONLY));
// Set up the WHERE clause value
ConstHostCollection
MySqlHostDataSource::getAll4(const asiolink::IOAddress& address) const {
- std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
+ thread_local std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
std::make_shared<MySqlHostWithOptionsExchange>(MySqlHostWithOptionsExchange::DHCP4_ONLY));
// Set up the WHERE clause value
const Host::IdentifierType& identifier_type,
const uint8_t* identifier_begin,
const size_t identifier_len) const {
- std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
+ thread_local std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
std::make_shared<MySqlHostWithOptionsExchange>(MySqlHostWithOptionsExchange::DHCP4_ONLY));
return (impl_->getHost(subnet_id, identifier_type, identifier_begin,
"wrong address type, address supplied is an IPv6 address");
}
- std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
+ thread_local std::shared_ptr<MySqlHostWithOptionsExchange> host_ipv4_exchange(
std::make_shared<MySqlHostWithOptionsExchange>(MySqlHostWithOptionsExchange::DHCP4_ONLY));
// Set up the WHERE clause value
const Host::IdentifierType& identifier_type,
const uint8_t* identifier_begin,
const size_t identifier_len) const {
- std::shared_ptr<MySqlHostIPv6Exchange> host_ipv6_exchange(
+ thread_local std::shared_ptr<MySqlHostIPv6Exchange> host_ipv6_exchange(
std::make_shared<MySqlHostIPv6Exchange>(MySqlHostWithOptionsExchange::DHCP6_ONLY));
return (impl_->getHost(subnet_id, identifier_type, identifier_begin,
"wrong address type, address supplied is an IPv4 address");
}
- std::shared_ptr<MySqlHostIPv6Exchange> host_ipv6_exchange(
+ thread_local std::shared_ptr<MySqlHostIPv6Exchange> host_ipv6_exchange(
std::make_shared<MySqlHostIPv6Exchange>(MySqlHostWithOptionsExchange::DHCP6_ONLY));
// Set up the WHERE clause value
"wrong address type, address supplied is an IPv4 address");
}
- std::shared_ptr<MySqlHostIPv6Exchange> host_ipv6_exchange(
+ thread_local std::shared_ptr<MySqlHostIPv6Exchange> host_ipv6_exchange(
std::make_shared<MySqlHostIPv6Exchange>(MySqlHostWithOptionsExchange::DHCP6_ONLY));
// Set up the WHERE clause value
bool
MySqlLeaseMgr::addLease(const Lease4Ptr& lease) {
- std::shared_ptr<MySqlLease4Exchange> exchange4(
+ thread_local std::shared_ptr<MySqlLease4Exchange> exchange4(
std::make_shared<MySqlLease4Exchange>());
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
bool
MySqlLeaseMgr::addLease(const Lease6Ptr& lease) {
- std::shared_ptr<MySqlLease6Exchange> exchange6(
+ thread_local std::shared_ptr<MySqlLease6Exchange> exchange6(
std::make_shared<MySqlLease6Exchange>());
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
void MySqlLeaseMgr::getLeaseCollection(StatementIndex stindex, MYSQL_BIND* bind,
Lease4Collection& result) const {
- std::shared_ptr<MySqlLease4Exchange> exchange4(
+ thread_local std::shared_ptr<MySqlLease4Exchange> exchange4(
std::make_shared<MySqlLease4Exchange>());
getLeaseCollection(stindex, bind, exchange4, result);
}
void MySqlLeaseMgr::getLeaseCollection(StatementIndex stindex, MYSQL_BIND* bind,
Lease6Collection& result) const {
- std::shared_ptr<MySqlLease6Exchange> exchange6(
+ thread_local std::shared_ptr<MySqlLease6Exchange> exchange6(
std::make_shared<MySqlLease6Exchange>());
getLeaseCollection(stindex, bind, exchange6, result);
}
void MySqlLeaseMgr::getLease(StatementIndex stindex, MYSQL_BIND* bind,
Lease4Ptr& result) const {
- std::shared_ptr<MySqlLease4Exchange> exchange4(
+ thread_local std::shared_ptr<MySqlLease4Exchange> exchange4(
std::make_shared<MySqlLease4Exchange>());
// Create appropriate collection object and get all leases matching
void MySqlLeaseMgr::getLease(StatementIndex stindex, MYSQL_BIND* bind,
Lease6Ptr& result) const {
- std::shared_ptr<MySqlLease6Exchange> exchange6(
+ thread_local std::shared_ptr<MySqlLease6Exchange> exchange6(
std::make_shared<MySqlLease6Exchange>());
// Create appropriate collection object and get all leases matching
void
MySqlLeaseMgr::updateLease4(const Lease4Ptr& lease) {
- std::shared_ptr<MySqlLease4Exchange> exchange4(
+ thread_local std::shared_ptr<MySqlLease4Exchange> exchange4(
std::make_shared<MySqlLease4Exchange>());
const StatementIndex stindex = UPDATE_LEASE4;
void
MySqlLeaseMgr::updateLease6(const Lease6Ptr& lease) {
- std::shared_ptr<MySqlLease6Exchange> exchange6(
+ thread_local std::shared_ptr<MySqlLease6Exchange> exchange6(
std::make_shared<MySqlLease6Exchange>());
const StatementIndex stindex = UPDATE_LEASE6;