BIND 10 #2206: define and implement ZoneTableSegment class
BIND 10 Development
do-not-reply at isc.org
Wed Aug 22 05:44:27 UTC 2012
#2206: define and implement ZoneTableSegment class
-------------------------------------+-------------------------------------
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.
>
> 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_;
> };
> }}}
New description:
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
differ 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#comment:1>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list