BIND 10 #2206: define and implement ZoneTableSegment class

BIND 10 Development do-not-reply at isc.org
Sat Aug 18 00:34:28 UTC 2012


#2206: define and implement ZoneTableSegment class
-------------------------------------+-------------------------------------
            Reporter:  jinmei        |                        Owner:
                Type:  task          |                       Status:  new
            Priority:  medium        |                    Milestone:  Next-
           Component:  data source   |  Sprint-Proposed
           Sensitive:  0             |                     Keywords:
         Sub-Project:  DNS           |              Defect Severity:  N/A
Estimated Difficulty:  0             |  Feature Depending on Ticket:
         Total Hours:  0             |  background zone loading
                                     |          Add Hours to Ticket:  0
                                     |                    Internal?:  0
-------------------------------------+-------------------------------------
 A subtask of #2201.

 The basic concept is described in
 http://bind10.isc.org/wiki/ScalableZoneLoadDesign.
 We also extend the class to encapsulate zone loading logic that can
 defer depending on the underlying memory segment model.

 A conceptual definition of this class is as follows:

 {{{#!cpp
 class ZoneTableSegment {
 public:
     // Factory method.
     // Create a subclass depending on the memory segment model (which
 would
     // be config).
     // For now, we simply always create ZoneTableSegment.
     static ZoneTableSegment* create(const data::Element& config);

     virtual ZoneTableHeader* getHeader() = 0;

     // Return the underlying memory segment.
     virtual MemorySegment& getMemorySegment() = 0;

 #ifdef notyet
     // Factory of zone updater context using the same memory model as the
     // zone table (and maybe internally using zone table itself).
     // config would store the zone name to be loaded or zone segment ID,
 etc.
     // load_action will be called from updater->load() to perform
     // caller-specific behavior (in the case of local memory segment, this
     // action will actually load the zone content to the memory)
     // install_action will be called from updater->install() to perform
     // caller-specific behavior (in the case of local memory segment, this
     // would probably be mostly NO-OP)
     virtual ZoneUpdater* getZoneUpdater(
         const data::Element& config,
         boost::function<void(memory::ZoneData*)> load_action,
         boost::function<void(ZoneSegmentID, ZoneSegment*> install_action))
 = 0;
 #endif
 };
 }}}

 For now, we only define create() and getHeader().

 Also define the trivial `ZoneTableHeader`:

 {{{#!cpp
 struct ZoneTableHeader {
     offset_ptr<memory::ZoneTable> table;
 };
 }}}

 And introduce the `ZoneTableSegmentLocal` derived class:

 {{{#!cpp
 // ZoneTableSegment using the "local" memory segment
 class ZoneTableSegmentLocal : public ZoneTableSegment {
 public:
 #ifdef notyet
     virtual ZoneUpdater* getZoneUpdater() {
         return (new ZoneUpdaterLocal(*this));
     }
 #endif
 private:
     MemorySegmentLocal mem_sgmt_;
 };
 }}}

-- 
Ticket URL: <http://bind10.isc.org/ticket/2206>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list