BIND 10 #2209: define and implement ConfigurableClientList::getCacheZoneUpdater()

BIND 10 Development do-not-reply at isc.org
Sat Aug 18 07:15:12 UTC 2012


#2209: define and implement ConfigurableClientList::getCacheZoneUpdater()
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:
  jinmei                             |                Status:  new
                       Type:  task   |             Milestone:  Next-Sprint-
                   Priority:         |  Proposed
  medium                             |            Resolution:
                  Component:  data   |             Sensitive:  0
  source                             |           Sub-Project:  DNS
                   Keywords:         |  Estimated Difficulty:  0
            Defect Severity:  N/A    |           Total Hours:  0
Feature Depending on Ticket:         |
  background zone loading            |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Description changed by jinmei:

Old description:

> A subtask of #2201, depend on #2206, #2207.
>
> This is a new method to `ConfigurableClientList` and will eventually
> replace reload().  conceptually it would look this:
>
> {{{#!cpp
> shared_ptr<memory::ZoneUpdater>
> ConfigurableClientList::getCacheZoneUpdater(config) {
>     // identify the in-memory client
>     if (type == "MasterFiles") {
>         updater = mem_client->ztable_segment->getZoneUpdater(
>             config,
>             boost::bind(loadMemoryZoneFromFile, master_file, _1),
>             boost::bind(&InMemoryClient::installZone, mem_client, _1));
>         return (updater);
>     } else {
>         updater = mem_client->ztable_segment->getZoneUpdater(
>             config,
>             boost::bind(loadMemoryZoneFromDataSource, backend_client,
> _1),
>             boost::bind(&InMemoryClient::installZone, mem_client, _1));
>         return (updater);
>
>     }
> }
>
> void
> loadMemoryZoneFromFile(ZoneData* zone_data, string zone_file) {
>     // fill in zone_data from zone_file
> }
>
> void
> loadMemoryZoneFromDataSource(ZoneData* zone_data, DataSourceClient*
> backend) {
>     // fill in zone_data using backends' iterator
> }
> }}}
>
> We should already have something close to the two load_action
> callbacks.  We should only have to adjust the interface.
>
> installZone would reset the corresponding zone segment for shared
> memory version.  For the moment that could be an empty functor object.

New description:

 A subtask of #2201, depend on #2206, #2207.

 This is a new method to `ConfigurableClientList` and will eventually
 replace reload().  conceptually it would look this:

 {{{#!cpp
 shared_ptr<memory::ZoneUpdater>
 ConfigurableClientList::getCacheZoneUpdater(config) {
     // identify the in-memory client
     if (type == "MasterFiles") {
         updater = mem_client->ztable_segment->getZoneUpdater(
             config,
             boost::bind(loadMemoryZoneFromFile, master_file, _1),
             boost::bind(&InMemoryClient::installZone, mem_client, _1));
         return (updater);
     } else {
         updater = mem_client->ztable_segment->getZoneUpdater(
             config,
             boost::bind(loadMemoryZoneFromDataSource, backend_client, _1),
             boost::bind(&InMemoryClient::installZone, mem_client, _1));
         return (updater);

     }
 }

 void
 loadMemoryZoneFromFile(ZoneData* zone_data, string zone_file) {
     // fill in zone_data from zone_file
 }

 void
 loadMemoryZoneFromDataSource(ZoneData* zone_data, DataSourceClient*
 backend) {
     // fill in zone_data using backends' iterator
 }
 }}}

 We should already have something close to the two load_action
 callbacks.  We should only have to adjust the interface.

 Unlike reload(), 'config' is more generic, and the content varies
 depending on the underlying memory segment model.  When we use the
 local memory segment (which is the case for the moment) it would
 simply contain the information of zone name; when we use a shared
 memory segment, it will simply contain shared segment info for the new
 zone segment.  The getZoneUpdater() hides these details from the
 `ConfigurableClientList` implementation.

 installZone would reset the corresponding zone segment for shared
 memory version.  For the moment that could be an empty functor object.

--

-- 
Ticket URL: <http://bind10.isc.org/ticket/2209#comment:1>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list