Commit bbb8a8f0 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2432] Use RRCollator during RRsetCollection construction (zone-loading)

parent ee424bbc
......@@ -15,6 +15,7 @@
#include <dns/rrset_collection.h>
#include <dns/master_loader_callbacks.h>
#include <dns/master_loader.h>
#include <dns/rrcollator.h>
#include <exceptions/exceptions.h>
......@@ -31,16 +32,6 @@ RRsetCollection::loaderCallback(const std::string&, size_t, const std::string&)
// We just ignore callbacks for errors and warnings.
}
void
RRsetCollection::addRRset(const Name& name, const RRClass& rrclass,
const RRType& rrtype, const RRTTL& rrttl,
const rdata::RdataPtr& data)
{
RRsetPtr rrset(new BasicRRset(name, rrclass, rrtype, rrttl));
rrset->addRdata(data);
addRRset(rrset);
}
void
RRsetCollection::addRRset(RRsetPtr rrset) {
const CollectionKey key(rrset->getClass(), rrset->getType(),
......@@ -60,14 +51,15 @@ void
RRsetCollection::constructHelper(T source, const isc::dns::Name& origin,
const isc::dns::RRClass& rrclass)
{
RRCollator collator(boost::bind(&RRsetCollection::addRRset, this, _1));
MasterLoaderCallbacks callbacks
(boost::bind(&RRsetCollection::loaderCallback, this, _1, _2, _3),
boost::bind(&RRsetCollection::loaderCallback, this, _1, _2, _3));
MasterLoader loader(source, origin, rrclass, callbacks,
boost::bind(&RRsetCollection::addRRset,
this, _1, _2, _3, _4, _5),
collator.getCallback(),
MasterLoader::DEFAULT);
loader.load();
collator.flush();
}
RRsetCollection::RRsetCollection(const char* filename, const Name& origin,
......
......@@ -121,9 +121,6 @@ private:
template<typename T>
void constructHelper(T source, const isc::dns::Name& origin,
const isc::dns::RRClass& rrclass);
void addRRset(const isc::dns::Name& name, const isc::dns::RRClass& rrclass,
const isc::dns::RRType& rrtype, const isc::dns::RRTTL& rrttl,
const isc::dns::rdata::RdataPtr& data);
void loaderCallback(const std::string&, size_t, const std::string&);
typedef boost::tuple<isc::dns::RRClass, isc::dns::RRType, isc::dns::Name>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment