On 04 Aug 2014, at 16:27, Jason Greene <jason.greene(a)redhat.com> wrote:
POC, I am using a single Map to retain the handler and is separate from the resource
tree.
> The Map keys are the path address from the
registerNotificationHandler() method (that can be wildcard addresses).
> When a notification is emitted, I iterate on its entries to find the handlers that
match the actual address of resource emitting the notification.
> I.e. the data structure grows with the number of handlers, not with the resources
that emits notifications.
Is this map broken up into path segments to mitigate the o(n) cost?
e.g.determining if /x=blah/y=foo/z=bar matches x=blah/y=foo/* = 2 O(1) map lookups
This is definitely something I need to do to decrease the lookup cost.
I’ll have a look if I can reuse the code from our resource registry for that.
thanks,
jeff
--
Jeff Mesnil
JBoss, a division of Red Hat
http://jmesnil.net/