BUG-8733: Add ListenableDOMDataTreeShard 99/60999/2
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 21 Jul 2017 09:45:24 +0000 (11:45 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 1 Aug 2017 15:10:10 +0000 (17:10 +0200)
commit87a374b8197e5e4d3feb482445100ac9eacc40ca
tree141d2a1ac7f70033f37c00220a200ff99021a94e
parenteb88b5b39a7a1f4cfdd92fc85bb0e7ccfbd72b16
BUG-8733: Add ListenableDOMDataTreeShard

Implementation reliance on DOMDataTreeChangePublisher is a mistake
coming from similarities between interfaces. DOMDataTreeShard interfaces
should work with DOMDataTreeListener instances, not DOMDataTreeChangeListener.

This patch introduces ListenableDOMDataTreeShard, which exposes a proper
SPI-level method for registering DOMDataTreeListeners.

It also adds AbstractStateAggregator, which can be used to efficiently
aggregate multiple listeners into a single upcall, without the synchronization
overhead of ShardedDOMDataTreeListenerContext.

This class is then used to build DOMDataTreeChangeListenerAggregator for
bridging the old approach with ListenableDOMDataTreeShard via a utility
proxy, CompatListenableDOMDataTreeShard.

We also introduce DOMDataTreeListenerAggregator, which performs aggregation
of multiple DOMDataTreeListeners and is useful for ListenableDOMDataTreeShard
implementations where requested subtrees live in multiple child shards.

Change-Id: I979610e032605ade6d68196d51ae62778311f8c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit f09e24084d3ed855d60647f822bae9f663599c75)
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/ShardedDOMDataTreeListenerContext.java
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/shard/AbstractStateAggregator.java [new file with mode: 0644]
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/shard/CompatDOMDataTreeListenerRegistry.java [new file with mode: 0644]
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/shard/CompatListenableDOMDataTreeShard.java [new file with mode: 0644]
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/shard/DOMDataTreeChangeListenerAggregator.java [new file with mode: 0644]
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/shard/DOMDataTreeListenerAggregator.java [new file with mode: 0644]
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/shard/DOMDataTreeListenerRegistry.java [new file with mode: 0644]
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/shard/ListenableDOMDataTreeShard.java [new file with mode: 0644]
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/shard/ReadableWriteableDOMDataTreeShard.java
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/shard/WriteableDOMDataTreeShard.java