X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fbroker%2Fimpl%2FShardedDOMDataTree.java;h=9e7596f5561821dc2078c1bd4b080640bf6edd79;hp=7af8d2c72026a470a654c914aa4d6b79c039cb43;hb=0b161730fd648bfa4c953e84b2d6a66972bc4da2;hpb=89b1c5b7d66614d1b98ec14abc3326fb878eb056 diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTree.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTree.java index 7af8d2c720..9e7596f556 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTree.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTree.java @@ -28,12 +28,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** + * Shared DOM data tree. + * * @deprecated Use {@link org.opendaylight.mdsal.dom.broker.ShardedDOMDataTree} instead. */ @Deprecated public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTreeShardingService { private static final Logger LOG = LoggerFactory.getLogger(ShardedDOMDataTree.class); - private final Map shardingTables = new EnumMap<>(LogicalDatastoreType.class); + private final Map shardingTables = new EnumMap<>( + LogicalDatastoreType.class); @GuardedBy("this") private final Map idToProducer = new TreeMap<>(); @@ -49,9 +52,10 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree @GuardedBy("this") private void storeShard(final DOMDataTreeIdentifier prefix, final ShardRegistration reg) { - ShardingTableEntry t = shardingTables.computeIfAbsent(prefix.getDatastoreType(), k -> new ShardingTableEntry()); + ShardingTableEntry shardingTableEntry = shardingTables + .computeIfAbsent(prefix.getDatastoreType(), k -> new ShardingTableEntry()); - t.store(prefix.getRootIdentifier(), reg); + shardingTableEntry.store(prefix.getRootIdentifier(), reg); } void removeShard(final ShardRegistration reg) { @@ -82,7 +86,8 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree } @Override - public ListenerRegistration registerDataTreeShard(final DOMDataTreeIdentifier prefix, final T shard) throws DOMDataTreeShardingConflictException { + public ListenerRegistration registerDataTreeShard( + final DOMDataTreeIdentifier prefix, final T shard) throws DOMDataTreeShardingConflictException { final ShardRegistration reg; final ShardRegistration parentReg; @@ -95,7 +100,8 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree final ShardingTableEntry parent = lookupShard(prefix); parentReg = parent.getRegistration(); if (parentReg != null && prefix.equals(parentReg.getPrefix())) { - throw new DOMDataTreeShardingConflictException(String.format("Prefix %s is already occupied by shard %s", prefix, parentReg.getInstance())); + throw new DOMDataTreeShardingConflictException( + String.format("Prefix %s is already occupied by shard %s", prefix, parentReg.getInstance())); } // FIXME: wrap the shard in a proper adaptor based on implemented interface @@ -162,7 +168,8 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree return createProducer(shardMap); } - synchronized DOMDataTreeProducer createProducer(final ShardedDOMDataTreeProducer parent, final Collection subtrees) { + synchronized DOMDataTreeProducer createProducer(final ShardedDOMDataTreeProducer parent, + final Collection subtrees) { Preconditions.checkNotNull(parent); final Map shardMap = new HashMap<>(); @@ -174,7 +181,11 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree } @Override - public synchronized ListenerRegistration registerListener(final T listener, final Collection subtrees, final boolean allowRxMerges, final Collection producers) { + public synchronized ListenerRegistration + registerListener(final T listener, + final Collection subtrees, + final boolean allowRxMerges, + final Collection producers) { // FIXME Implement this. throw new UnsupportedOperationException("Not implemented yet."); }