X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fbroker%2Fimpl%2FShardedDOMDataTreeProducer.java;h=9b485df13a95a0b4a9e038c607a016a058a543f8;hb=03e639ec0e4b1b2a55a8763b5642b1118e52861c;hp=9712b25ac9c805d6b85f0b4531656cb01b2fb5ac;hpb=64db87e8fb5de25e68ba824ec2eaa17e3f217c96;p=controller.git diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTreeProducer.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTreeProducer.java index 9712b25ac9..9b485df13a 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTreeProducer.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTreeProducer.java @@ -54,13 +54,13 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { final Builder cb = ImmutableBiMap.builder(); final Queue es = new LinkedList<>(); - for (DOMDataTreeShard s : shards) { + for (final DOMDataTreeShard s : shards) { if (s instanceof DOMStore) { try { final DOMStoreTransactionChain c = ((DOMStore)s).createTransactionChain(); LOG.trace("Using DOMStore chain {} to access shard {}", c, s); cb.put(s, c); - } catch (Exception e) { + } catch (final Exception e) { LOG.error("Failed to instantiate chain for shard {}", s, e); es.add(e); } @@ -72,11 +72,11 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { // An error was encountered, close chains and report the error if (shardToChain.size() != shards.size()) { - for (DOMStoreTransactionChain c : shardToChain.values()) { + for (final DOMStoreTransactionChain c : shardToChain.values()) { try { c.close(); - } catch (Exception e) { - LOG.warn("Exception raised while closing chain %s", c, e); + } catch (final Exception e) { + LOG.warn("Exception raised while closing chain {}", c, e); } } @@ -98,13 +98,13 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { // Allocate backing transactions final Map shardToTx = new HashMap<>(); - for (Entry e : shardToChain.entrySet()) { + for (final Entry e : shardToChain.entrySet()) { shardToTx.put(e.getKey(), e.getValue().newWriteOnlyTransaction()); } // Create the ID->transaction map final ImmutableMap.Builder b = ImmutableMap.builder(); - for (Entry e : idToShard.entrySet()) { + for (final Entry e : idToShard.entrySet()) { b.put(e.getKey(), shardToTx.get(e.getValue())); } @@ -115,7 +115,7 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { @GuardedBy("this") private boolean haveSubtree(final DOMDataTreeIdentifier subtree) { - for (DOMDataTreeIdentifier i : idToShard.keySet()) { + for (final DOMDataTreeIdentifier i : idToShard.keySet()) { if (i.contains(subtree)) { return true; } @@ -126,7 +126,7 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { @GuardedBy("this") private DOMDataTreeProducer lookupChild(final DOMDataTreeIdentifier s) { - for (Entry e : children.entrySet()) { + for (final Entry e : children.entrySet()) { if (e.getKey().contains(s)) { return e.getValue(); } @@ -140,7 +140,7 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { Preconditions.checkState(!closed, "Producer is already closed"); Preconditions.checkState(openTx == null, "Transaction %s is still open", openTx); - for (DOMDataTreeIdentifier s : subtrees) { + for (final DOMDataTreeIdentifier s : subtrees) { // Check if the subtree was visible at any time if (!haveSubtree(s)) { throw new IllegalArgumentException(String.format("Subtree %s was never available in producer %s", s, this)); @@ -151,7 +151,7 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { Preconditions.checkArgument(child == null, "Subtree %s is delegated to child producer %s", s, child); // Check if part of the requested subtree is not delegated to a child. - for (DOMDataTreeIdentifier c : children.keySet()) { + for (final DOMDataTreeIdentifier c : children.keySet()) { if (s.contains(c)) { throw new IllegalArgumentException(String.format("Subtree %s cannot be delegated as it is superset of already-delegated %s", s, c)); } @@ -161,7 +161,7 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { final DOMDataTreeProducer ret = dataTree.createProducer(this, subtrees); final ImmutableMap.Builder cb = ImmutableMap.builder(); cb.putAll(children); - for (DOMDataTreeIdentifier s : subtrees) { + for (final DOMDataTreeIdentifier s : subtrees) { cb.put(s, ret); }