X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fsharding%2FDistributedShardedDOMDataTree.java;h=564fb978bee42cc41c4f87c2fa8f03a94fb0c57d;hb=d65678cef128d33202318409ec52146722ae5318;hp=424439f6e58bbc62e28e914514b6f23516771f1f;hpb=c11dae56ca449d754db98fb8de194594c84d1f24;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTree.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTree.java index 424439f6e5..564fb978be 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTree.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTree.java @@ -464,8 +464,9 @@ public class DistributedShardedDOMDataTree implements DOMDataTreeService, DOMDat DOMDataTreePrefixTableEntry> lookupShardFrontend( final DOMDataTreeIdentifier prefix) { - return shards.lookup(prefix); - + synchronized (shards) { + return shards.lookup(prefix); + } } DOMDataTreeProducer localCreateProducer(final Collection prefix) { @@ -675,7 +676,7 @@ public class DistributedShardedDOMDataTree implements DOMDataTreeService, DOMDat final Object o = actorContext.executeOperation(shardDataTreeActor, new ProducerRemoved(subtrees)); if (o instanceof DOMDataTreeProducerException) { - throw ((DOMDataTreeProducerException) o); + throw (DOMDataTreeProducerException) o; } else if (o instanceof Throwable) { throw new DOMDataTreeProducerException("Unable to close producer", (Throwable) o); } @@ -701,7 +702,8 @@ public class DistributedShardedDOMDataTree implements DOMDataTreeService, DOMDat // producer attached to some subtree at a time. And also how we can close ShardAccess // then final CDSShardAccessImpl shardAccess = new CDSShardAccessImpl(subtree, actorContext); - return shardAccessMap.put(subtree, shardAccess); + shardAccessMap.put(subtree, shardAccess); + return shardAccess; } } }