BUG-648: Create MapAdaptor and friends 31/7431/6
authorRobert Varga <rovarga@cisco.com>
Tue, 27 May 2014 11:40:19 +0000 (13:40 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Wed, 28 May 2014 14:26:14 +0000 (16:26 +0200)
commit0bf93036684b36c143ded51f048181322e3b545c
tree37d6c7a1100a1bb1088f175bc56114b2538bc514
parent20a26f7fdcf0e097c428972040b85408c62b42b7
BUG-648: Create MapAdaptor and friends

This introduces the MapAdaptor class, which allows transforming one Map
implementation to another, balancing the isolation and access patterns.

The core of the idea is that we are using patterns which would benefit
from persistent structures where we can take a point-in-time stable
snapshot, update it and publish the new version all the while clients
accessing the old version suspect nothing. So far we have implemented
the isolation by copying maps around -- which is fine as long as there
are not too many elements.

We do have a persistent strucutre (Ctrie), which allows snapshot and
isolation to happen in O(1), but exacts heavy price on access due to
volatile variables.

Change-Id: I4b745eecc5a915862ab75921703cfce3c2747ab6
Signed-off-by: Robert Varga <rovarga@cisco.com>
common/pom.xml
common/util/pom.xml [new file with mode: 0644]
common/util/src/main/java/org/opendaylight/yangtools/util/MapAdaptor.java [new file with mode: 0644]
common/util/src/main/java/org/opendaylight/yangtools/util/ReadOnlyTrieMap.java [new file with mode: 0644]
common/util/src/main/java/org/opendaylight/yangtools/util/ReadWriteTrieMap.java [new file with mode: 0644]
common/util/src/test/java/org/opendaylight/yangtools/util/MapAdaptorTest.java [new file with mode: 0644]
pom.xml