BIND 10 #3002: extend datasrc::(Configurable)ClientList::find to return data source name
BIND 10 Development
do-not-reply at isc.org
Thu Jun 13 16:30:00 UTC 2013
#3002: extend datasrc::(Configurable)ClientList::find to return data source name
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: task | Status: new
Priority: medium | Milestone: New
Component: data source | Tasks
Keywords: | Resolution:
Sensitive: 0 | CVSS Scoring:
Sub-Project: DNS | Defect Severity: N/A
Estimated Difficulty: 0 | Feature Depending on Ticket:
Total Hours: 0 | shared memory data source
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
Comment (by jinmei):
Replying to [comment:1 vorner]:
> Isn't the name stored as a string directly in the client list somewhere?
So if we returned just const reference to it, it should be safe to use
that as long as we don't reconfigure the client list and it would be cheap
operation, so we wouldn't need the boolean flag and could return it every
time. It could be simpler interface (and backwards compatible).
The data source name is stored in `DataSourceInfo`
(ref.
http://bind10.isc.org/attachment/wiki/DataSourceClasses/overview.png).
I'm not sure what exactly you meant above, but from that I guess one
other approach is to include `DataSourceInfo` in `ClientList::FindResult`
as a private member, and provide accessor(s) to some selected members
such as data_src_client_ or name_ (although I'd like to hide the
existence of `DataSourceInfo` as much as possible even as a private
member of some other class, and in that sense this approach is not
very clean). With this approach we'll probably need to maintain
`DataSourceInfo` as a shared pointer in the vector, and this will
eliminate the need for the `LifeKeeper` trick.
Yet another approach is to simply include the data source name
unconditionally. It's a bit suboptimal in terms of efficiency
especially because the data source name won't be needed in many cases
(and especially not in performance sensitive cases). But copying
std::string should be reasonably cheap for its common implementations
using a reference counter, and since `ClientList::find()` is called
only once in the entire query processing, this may be a reasonable
compromise.
--
Ticket URL: <https://bind10.isc.org/ticket/3002#comment:2>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list