BIND 10 #2912: make in-memory zone data loader a class
BIND 10 Development
do-not-reply at isc.org
Thu Apr 11 21:18:25 UTC 2013
#2912: make in-memory zone data loader a class
-------------------------------------+-------------------------------------
Reporter: | Owner:
jinmei | Status: new
Type: task | Milestone: Next-Sprint-
Priority: | Proposed
medium | Keywords:
Component: data | Sensitive: 0
source | Sub-Project: DNS
CVSS Scoring: | Estimated Difficulty: 0
Defect Severity: N/A | Total Hours: 0
Feature Depending on Ticket: |
shared memory data source |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
This is a first step to make it possible to apply a set of diffs
of a zone from a `ZoneJournalReader` into in-memory zone data
(so we can reflect IXFR/DDNS changes more quickly, and also eventually
use it at start up time with mapped memory segment).
Specifically, we'll make the `ZoneDataLoader` class defined in
memory/zone_data_loader.cc visible publicly (in practice, though, we
still intend to "hide" it inside the "memory" namespace), and replace
`loadZoneData()` with the new class.
The revised `ZoneDataLoader` class should look like:
{{{#!cpp
class ZoneDataLoader {
// Constructor for full load, from a zone file
ZoneDataLoader(MemorySegment& mem_sgmt, const RRClass&,
const Name&, const std::string&);
// Constructor for full load, from zone iterator
ZoneDataLoader(MemorySegment& mem_sgmt, const RRClass&,
const Name&, ZoneIteratorPtr);
#ifdef notyet
// Constructor for apply diff, from zone journal reader.
// The ZoneData* parameter will point to the current zone data
// to be updated.
ZoneDataLoader(MemorySegment& mem_sgmt, const RRClass&, const Name&,
ZoneJournalReaderPtr, ZoneData*);
#endif
// This corresponds to the current loadZoneData.
ZoneData* load();
// Incremental version of load(). works like
// dns::MasterLoader::loadIncremental()
pair<ZoneData*, bool> loadIncremental(size_t count);
// effectively, for the journal version only. for full load, this is
// no-op.
void commit();
};
}}}
`loadIncremental` is not absolutely necessary, but I've been feeling
we'll eventually want to switch to this mode even when we load in
background or in a separate memmgr process so we can react to shutdown
quickly even in the middle of loading a huge zone. I believe it's not
difficult to convert the current implementation to an incremental one
and make load() a trivial wrapper of it.
Note that until we also convert `CacheConfig` and `ZoneWriter`, we
still need to use the function versions. So, the function version
would instantiate this class object and call its load() in the mean
time.
In some sense this is just a refactoring of existing code. So I
believe this is not really difficult.
--
Ticket URL: <http://bind10.isc.org/ticket/2912>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list