BIND 10 #2913: update CacheConfig and ZoneWriter using class version of ZoneDataLoader
BIND 10 Development
do-not-reply at isc.org
Thu Apr 11 21:43:12 UTC 2013
#2913: update CacheConfig and ZoneWriter using class version of ZoneDataLoader
-------------------------------------+-------------------------------------
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 followup of #2912 and depends on it (also depends on
#2834 but assuming it's merged by the time we work on this task).
We'll update the `CacheConfig` class as follows:
{{{#!cpp
class CacheConfig {
public:
// A factory to create zone data loader with the context of cache
config.
typedef boost::function<ZoneDataLoader*(MemorySegment&, const
RRClass&,
const Name&, ZoneData*)
ZoneDataLoaderFactory;
// this will replace getLoadAction. cache_client and options won't be
// used for now. cache_client will be the corresponding
InMemoryClient
// and options are some numeric type that supports operator| (logical
or).
// it mostly works like getLoadAction(), but returns a factory functor
// (defined above) depending on the cache configuration.
ZoneDataLoaderFactory createZoneDataLoader(
const RRClass& rrclass, const Name& zname,
DataSourceClientPtr cache_client, Options options);
}
}}}
We'll also update `ZoneWriter` (it's not a base class after #2850) so
- its constructor takes `ZoneDataLoaderFactory`
- load and install methods will be revised as follows:
{{{#!cpp
void
ZoneWriter::load() {
// loader_ is of scoped_ptr<ZoneDataLoader>
loader_.reset(loader_factory_(segment_->getMemorySegment(), zclass,
zname,
segment_->getHeader().getZoneTable()));
loader_->load();
}
void
ZoneWriter::install() {
loader_->commit(); // note that it's no-op for now
table->addZone();
}
}}}
When this is done, we could remove the function versions of
`loadZoneData()` (but we could keep them if we find it convenient).
We can also remove `CacheConfig::getLoadAction()` and load_action.h.
Also, if the work so far is not big, consider adding
`loadIncrement(count)` to ZoneWriter. That should be basically trivial.
--
Ticket URL: <http://bind10.isc.org/ticket/2913>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list