BIND 10 #2207: define and implement (datasrc::memory::)ZoneUpdater class
BIND 10 Development
do-not-reply at isc.org
Tue Sep 4 06:31:28 UTC 2012
#2207: define and implement (datasrc::memory::)ZoneUpdater 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: 7
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.
>
> See the conceptual definition below.
>
> {{{#!cpp
> // Provide interfaces for staged zone loading, hiding the underlying
> // memory segment model.
> class isc::datasrc::memory::ZoneUpdater {
> public:
> // (Conceptually) load zone(s) content in memory. This can take
> // long time.
> // For the local memory segment version, it creates a new ZoneData
> using
> // the zone table's local memory segment, and load the zone using
> // the given load_action.
> // For the shared memory segment version, this is probably no-op
> // (the time consuming part should have been done by the
> "b10-memmgr")
> virtual void load() = 0;
>
> // Install the new zone image so it can actually be used by the
> caller.
> // For the local memory segment version, it saves the old version of
> // ZoneData from the table and inserts the newly created one in
> load()
> // to the zone table.
> // The shared memory version would just internally create
> // a new MemorySegment object with a given shared segment parameter,
> // and pass it to the caller via the install_action.
> virtual void install() = 0;
>
> // (Conceptually) release any resource used for the older version of
> zone.
> // This can take long time.
> // The local memory version destroys the saved (in install()) old
> version
> // of ZoneData.
> // The share memory version would probably be no-op.
> virtual void cleanup() = 0;
> };
> }}}
>
> And implement the `ZoneUpdaterLocal` derived class:
>
> {{{#!cpp
> // local memory segment version of ZoneUpdater
> class ZoneUpdaterLocal : public ZoneUpdater {
> public:
> ZoneUpdaterLocal(ztable_segment, load_action, install_action);
> ...
> };
> }}}
>
> We also need to define `ZoneSegment` class, which is supposed to be
> used as a parameter of the install_action callback. For the moment we
> don't need to use it, so it can be an empty class:
>
> {{{#!cpp
> // Eventually this will become an abstract base class
> class ZoneSegment {}
> }}}
>
> Finally, add the getZoneUpdater() method to `ZoneTableSegment`
> (see #2206) and implement it for `ZoneTableSegmentLocal`.
New description:
(We probably don't have time to do this for the September release)
A subtask of #2201, depend on #2206.
See the conceptual definition below.
{{{#!cpp
// Provide interfaces for staged zone loading, hiding the underlying
// memory segment model.
class isc::datasrc::memory::ZoneUpdater {
public:
// (Conceptually) load zone(s) content in memory. This can take
// long time.
// For the local memory segment version, it creates a new ZoneData
using
// the zone table's local memory segment, and load the zone using
// the given load_action.
// For the shared memory segment version, this is probably no-op
// (the time consuming part should have been done by the "b10-memmgr")
virtual void load() = 0;
// Install the new zone image so it can actually be used by the
caller.
// For the local memory segment version, it saves the old version of
// ZoneData from the table and inserts the newly created one in
load()
// to the zone table.
// The shared memory version would just internally create
// a new MemorySegment object with a given shared segment parameter,
// and pass it to the caller via the install_action.
virtual void install() = 0;
// (Conceptually) release any resource used for the older version of
zone.
// This can take long time.
// The local memory version destroys the saved (in install()) old
version
// of ZoneData.
// The share memory version would probably be no-op.
virtual void cleanup() = 0;
};
}}}
And implement the `ZoneUpdaterLocal` derived class:
{{{#!cpp
// local memory segment version of ZoneUpdater
class ZoneUpdaterLocal : public ZoneUpdater {
public:
ZoneUpdaterLocal(ztable_segment, load_action, install_action);
...
};
}}}
We also need to define `ZoneSegment` class, which is supposed to be
used as a parameter of the install_action callback. For the moment we
don't need to use it, so it can be an empty class:
{{{#!cpp
// Eventually this will become an abstract base class
class ZoneSegment {}
}}}
Finally, add the getZoneUpdater() method to `ZoneTableSegment`
(see #2206) and implement it for `ZoneTableSegmentLocal`.
--
--
Ticket URL: <http://bind10.isc.org/ticket/2207#comment:2>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list