From: Tom Pantelis Date: Tue, 25 Oct 2016 12:04:08 +0000 (-0400) Subject: Fix remaining CS warnings in sal-distributed-datastore X-Git-Tag: release/carbon~423 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=a510fba141230ce9fe8301f9eb0198cc09df46ca Fix remaining CS warnings in sal-distributed-datastore Fixed remaining warnings and enabled enforcement. Most of the warnings/changes were for: - white space before beginning brace - line too long - illegal catching of Exception (suppressed) - variable name too short - javadoc issues Change-Id: I5ae5cf9276e0884595137d551a311e8322b2e25e Signed-off-by: Tom Pantelis --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/pom.xml b/opendaylight/md-sal/sal-distributed-datastore/pom.xml index b944633017..394d3816e2 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/pom.xml +++ b/opendaylight/md-sal/sal-distributed-datastore/pom.xml @@ -248,6 +248,13 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + + checkstyle.violationSeverity=error + + org.jacoco jacoco-maven-plugin diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java index 593944f081..b164157982 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java @@ -82,7 +82,7 @@ abstract class AbstractClientHistory extends LocalAbortable implements Identifia } /** - * Callback invoked from {@link ClientTransaction} when a transaction has been sub + * Callback invoked from {@link ClientTransaction} when a transaction has been submitted. * * @param transaction Transaction handle */ diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyHistory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyHistory.java index 9093c08097..f21be06f40 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyHistory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyHistory.java @@ -33,7 +33,8 @@ abstract class AbstractProxyHistory implements Identifiable backendInfo, final LocalHistoryIdentifier identifier) { final Optional dataTree = backendInfo.flatMap(ShardBackendInfo::getDataTree); - return dataTree.isPresent() ? new LocalProxyHistory(client, identifier, dataTree.get()) : new RemoteProxyHistory(client, identifier); + return dataTree.isPresent() ? new LocalProxyHistory(client, identifier, dataTree.get()) + : new RemoteProxyHistory(client, identifier); } @Override @@ -49,6 +50,6 @@ abstract class AbstractProxyHistory implements Identifiable * This class is not safe to access from multiple application threads, as is usual for transactions. Internal state * transitions coming from interactions with backend are expected to be thread-safe. * + *

* This class interacts with the queueing mechanism in ClientActorBehavior, hence once we arrive at a decision * to use either a local or remote implementation, we are stuck with it. We can re-evaluate on the next transaction. * @@ -90,7 +92,7 @@ abstract class AbstractProxyTransaction implements Identifiable ret) { + checkSealed(); + + sendRequest(new TransactionAbortRequest(getIdentifier(), nextSequence(), localActor()), t -> { + if (t instanceof TransactionAbortSuccess) { + ret.voteYes(); + } else if (t instanceof RequestFailure) { + ret.voteNo(((RequestFailure) t).getCause()); + } else { + ret.voteNo(new IllegalStateException("Unhandled response " + t.getClass())); + } + }); + } + /** * Commit this transaction, possibly in a coordinated fashion. * @@ -133,20 +149,6 @@ abstract class AbstractProxyTransaction implements Identifiable ret) { - checkSealed(); - - sendRequest(new TransactionAbortRequest(getIdentifier(), nextSequence(), localActor()), t -> { - if (t instanceof TransactionAbortSuccess) { - ret.voteYes(); - } else if (t instanceof RequestFailure) { - ret.voteNo(((RequestFailure) t).getCause()); - } else { - ret.voteNo(new IllegalStateException("Unhandled response " + t.getClass())); - } - }); - } - void canCommit(final VotingFuture ret) { checkSealed(); @@ -164,7 +166,7 @@ abstract class AbstractProxyTransaction implements Identifiable ret) { checkSealed(); - sendRequest(new TransactionPreCommitRequest(getIdentifier(), nextSequence(), localActor()), t-> { + sendRequest(new TransactionPreCommitRequest(getIdentifier(), nextSequence(), localActor()), t -> { if (t instanceof TransactionPreCommitSuccess) { ret.voteYes(); } else if (t instanceof RequestFailure) { @@ -178,7 +180,7 @@ abstract class AbstractProxyTransaction implements Identifiable ret) { checkSealed(); - sendRequest(new TransactionDoCommitRequest(getIdentifier(), nextSequence(), localActor()), t-> { + sendRequest(new TransactionDoCommitRequest(getIdentifier(), nextSequence(), localActor()), t -> { if (t instanceof TransactionCommitSuccess) { ret.voteYes(); } else if (t instanceof RequestFailure) { @@ -189,6 +191,8 @@ abstract class AbstractProxyTransaction implements Identifiable doCommit(boolean coordinated); + abstract void doDelete(final YangInstanceIdentifier path); abstract void doMerge(final YangInstanceIdentifier path, final NormalizedNode data); @@ -197,11 +201,10 @@ abstract class AbstractProxyTransaction implements Identifiable doExists(final YangInstanceIdentifier path); - abstract CheckedFuture>, ReadFailedException> doRead(final YangInstanceIdentifier path); + abstract CheckedFuture>, ReadFailedException> doRead( + final YangInstanceIdentifier path); abstract void doSeal(); abstract void doAbort(); - - abstract TransactionRequest doCommit(boolean coordinated); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientLocalHistory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientLocalHistory.java index be94e3ee6a..807cf98cb7 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientLocalHistory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientLocalHistory.java @@ -18,6 +18,7 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier * Client-side view of a local history. This class tracks all state related to a particular history and routes * frontend requests towards the backend. * + *

* This interface is used by the world outside of the actor system and in the actor system it is manifested via * its client actor. That requires some state transfer with {@link DistributedDataStoreClientBehavior}. In order to * reduce request latency, all messages are carbon-copied (and enqueued first) to the client actor. diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransaction.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransaction.java index e8e75e90e2..0a1c8be247 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransaction.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransaction.java @@ -27,22 +27,28 @@ import org.slf4j.LoggerFactory; /** * Client-side view of a free-standing transaction. * + *

* This interface is used by the world outside of the actor system and in the actor system it is manifested via * its client actor. That requires some state transfer with {@link DistributedDataStoreClientBehavior}. In order to * reduce request latency, all messages are carbon-copied (and enqueued first) to the client actor. * + *

* It is internally composed of multiple {@link RemoteProxyTransaction}s, each responsible for a component shard. * + *

* Implementation is quite a bit complex, and involves cooperation with {@link AbstractClientHistory} for tracking * gaps in transaction identifiers seen by backends. * + *

* These gaps need to be accounted for in the transaction setup message sent to a particular backend, so it can verify * that the requested transaction is in-sequence. This is critical in ensuring that transactions (which are independent * entities from message queueing perspective) do not get reodered -- thus allowing multiple in-flight transactions. * + *

* Alternative would be to force visibility by sending an abort request to all potential backends, but that would mean * that even empty transactions increase load on all shards -- which would be a scalability issue. * + *

* Yet another alternative would be to introduce inter-transaction dependencies to the queueing layer in client actor, * but that would require additional indirection and complexity. * diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransactionCommitCohort.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransactionCommitCohort.java index 2521c38f91..a7de89aac3 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransactionCommitCohort.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransactionCommitCohort.java @@ -15,9 +15,6 @@ import java.util.List; final class ClientTransactionCommitCohort extends AbstractTransactionCommitCohort { private final List proxies; - /** - * @param clientTransaction - */ ClientTransactionCommitCohort(final Collection proxies) { this.proxies = ImmutableList.copyOf(proxies); } @@ -64,4 +61,4 @@ final class ClientTransactionCommitCohort extends AbstractTransactionCommitCohor return ret; } -} \ No newline at end of file +} diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DirectTransactionCommitCohort.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DirectTransactionCommitCohort.java index 007ac53d98..49b281aa3a 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DirectTransactionCommitCohort.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DirectTransactionCommitCohort.java @@ -19,9 +19,6 @@ import com.google.common.util.concurrent.ListenableFuture; final class DirectTransactionCommitCohort extends AbstractTransactionCommitCohort { private final AbstractProxyTransaction proxy; - /** - * @param clientTransaction - */ DirectTransactionCommitCohort(final AbstractProxyTransaction proxy) { this.proxy = Preconditions.checkNotNull(proxy); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClient.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClient.java index 0d22d564fe..273fd89919 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClient.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClient.java @@ -16,6 +16,7 @@ import org.opendaylight.yangtools.concepts.Identifiable; * Client interface for interacting with the frontend actor. This interface is the primary access point through * which the DistributedDataStore frontend interacts with backend Shards. * + *

* Keep this interface as clean as possible, as it needs to be implemented in thread-safe and highly-efficient manner. * * @author Robert Varga diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClientActor.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClientActor.java index de2c19572c..45875baa15 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClientActor.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClientActor.java @@ -45,14 +45,16 @@ public final class DistributedDataStoreClientActor extends AbstractClientActor { return new DistributedDataStoreClientBehavior(context, actorContext); } - public static Props props(final @Nonnull MemberName memberName, @Nonnull final String storeName, final ActorContext ctx) { + public static Props props(@Nonnull final MemberName memberName, @Nonnull final String storeName, + final ActorContext ctx) { final String name = "datastore-" + storeName; final FrontendIdentifier frontendId = FrontendIdentifier.create(memberName, FrontendType.forName(name)); return Props.create(DistributedDataStoreClientActor.class, () -> new DistributedDataStoreClientActor(frontendId, ctx)); } - public static DistributedDataStoreClient getDistributedDataStoreClient(final @Nonnull ActorRef actor, + @SuppressWarnings("checkstyle:IllegalCatch") + public static DistributedDataStoreClient getDistributedDataStoreClient(@Nonnull final ActorRef actor, final long timeout, final TimeUnit unit) { try { return (DistributedDataStoreClient) Await.result(ExplicitAsk.ask(actor, GET_CLIENT_FACTORY, diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClientBehavior.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClientBehavior.java index e3e781e4db..eb1dd17bfd 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClientBehavior.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClientBehavior.java @@ -29,21 +29,26 @@ import org.slf4j.LoggerFactory; * {@link ClientActorBehavior} acting as an intermediary between the backend actors and the DistributedDataStore * frontend. * + *

* This class is not visible outside of this package because it breaks the actor containment. Services provided to * Java world outside of actor containment are captured in {@link DistributedDataStoreClient}. * + *

* IMPORTANT: this class breaks actor containment via methods implementing {@link DistributedDataStoreClient} contract. * When touching internal state, be mindful of the execution context from which execution context, Actor * or POJO, is the state being accessed or modified. * + *

* THREAD SAFETY: this class must always be kept thread-safe, so that both the Actor System thread and the application * threads can run concurrently. All state transitions must be made in a thread-safe manner. When in * doubt, feel free to synchronize on this object. * + *

* PERFORMANCE: this class lies in a performance-critical fast path. All code needs to be concise and efficient, but * performance must not come at the price of correctness. Any optimizations need to be carefully analyzed * for correctness and performance impact. * + *

* TRADE-OFFS: part of the functionality runs in application threads without switching contexts, which makes it ideal * for performing work and charging applications for it. That has two positive effects: * - CPU usage is distributed across applications, minimizing work done in the actor thread @@ -123,6 +128,7 @@ final class DistributedDataStoreClientBehavior extends ClientActorBehavior imple // // + @SuppressWarnings("checkstyle:IllegalCatch") private static V returnIfOperational(final Map map, final K key, final V value, final Throwable aborted) { Verify.verify(map.put(key, value) == null); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/EmptyTransactionCommitCohort.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/EmptyTransactionCommitCohort.java index 7032660068..0884ed4a11 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/EmptyTransactionCommitCohort.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/EmptyTransactionCommitCohort.java @@ -14,6 +14,7 @@ import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCoh * An {@link AbstractTransactionCommitCohort} for use with empty transactions. This relies on the fact that no backends * have been touched, hence all state book-keeping needs to happen only locally and shares fate with the coordinator. * + *

* Therefore all methods can finish immediately without any effects. * * @author Robert Varga diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/GetClientRequest.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/GetClientRequest.java index 4bfd1c4a60..2b6785496e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/GetClientRequest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/GetClientRequest.java @@ -18,11 +18,11 @@ import com.google.common.base.Preconditions; final class GetClientRequest { private final ActorRef replyTo; - public GetClientRequest(final ActorRef replyTo) { + GetClientRequest(final ActorRef replyTo) { this.replyTo = Preconditions.checkNotNull(replyTo); } ActorRef getReplyTo() { return replyTo; } -} \ No newline at end of file +} diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalAbortable.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalAbortable.java index 5b0708f120..a6d86de014 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalAbortable.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalAbortable.java @@ -11,6 +11,7 @@ package org.opendaylight.controller.cluster.databroker.actors.dds; * Common interface for client histories and client transactions, which can be aborted immediately without replicating * the effect to the backend. This is needed for abrupt shutdowns. * + *

* Since classes which need to expose this functionality do not need a base class, this is an abstract class and not * an interface -- which allows us to not leak the {@link #localAbort(Throwable)} method. * diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalProxyTransaction.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalProxyTransaction.java index b5eadb5abe..576fa67ed4 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalProxyTransaction.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalProxyTransaction.java @@ -29,10 +29,12 @@ import org.slf4j.LoggerFactory; * An {@link AbstractProxyTransaction} for dispatching a transaction towards a shard leader which is co-located with * the client instance. * + *

* It requires a {@link DataTreeSnapshot}, which is used to instantiated a new {@link DataTreeModification}. Operations * are then performed on this modification and once the transaction is submitted, the modification is sent to the shard * leader. * + *

* This class is not thread-safe as usual with transactions. Since it does not interact with the backend until the * transaction is submitted, at which point this class gets out of the picture, this is not a cause for concern. * diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ModuleShardBackendResolver.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ModuleShardBackendResolver.java index 495681cfdf..de115f0663 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ModuleShardBackendResolver.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ModuleShardBackendResolver.java @@ -93,10 +93,10 @@ final class ModuleShardBackendResolver extends BackendInfoResolver b = ImmutableBiMap.builder(); - b.putAll(shards); - b.put(shardName, cookie); - shards = b.build(); + Builder builder = ImmutableBiMap.builder(); + builder.putAll(shards); + builder.put(shardName, cookie); + shards = builder.build(); } } } @@ -132,9 +132,9 @@ final class ModuleShardBackendResolver extends BackendInfoResolver { - if (t != null) { - ret.completeExceptionally(t); + }).whenComplete((info, throwablw) -> { + if (throwablw != null) { + ret.completeExceptionally(throwablw); } else { ret.complete(info); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/RemoteProxyTransaction.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/RemoteProxyTransaction.java index bb21223aab..26d718def5 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/RemoteProxyTransaction.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/RemoteProxyTransaction.java @@ -39,9 +39,11 @@ import org.slf4j.LoggerFactory; * An {@link AbstractProxyTransaction} for dispatching a transaction towards a shard leader whose location is currently * not known or is known to be not co-located with the client. * + *

* It packages operations and sends them via the client actor queue to the shard leader. That queue is responsible for * maintaining any submitted operations until the leader is discovered. * + *

* This class is not safe to access from multiple application threads, as is usual for transactions. Its internal state * transitions based on backend responses are thread-safe. * @@ -193,7 +195,8 @@ final class RemoteProxyTransaction extends AbstractProxyTransaction { } } - private void completeRead(final SettableFuture>> future, final Response response) { + private void completeRead(final SettableFuture>> future, + final Response response) { LOG.debug("Read request completed with {}", response); if (response instanceof ReadTransactionSuccess) { diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/VotingFuture.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/VotingFuture.java index b6aba31e50..01298dfabf 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/VotingFuture.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/VotingFuture.java @@ -22,6 +22,7 @@ import javax.annotation.concurrent.GuardedBy; * an exception. This exception corresponds to the cause reported by the first 'no' vote, with all subsequent votes * added as suppressed exceptions. * + *

* Implementation is geared toward positive votes. Negative votes have to synchronize and therefore are more likely * to see contention. * @@ -53,7 +54,7 @@ class VotingFuture extends AbstractFuture { if (castVote()) { synchronized (failures) { resolveResult(); - } + } } } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LeaderLocalDelegateFactory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LeaderLocalDelegateFactory.java index 8e22d5f9e7..fbd974a1da 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LeaderLocalDelegateFactory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LeaderLocalDelegateFactory.java @@ -64,5 +64,6 @@ abstract class LeaderLocalDelegateFactory extends DelegateFactory operationsBatch = null; + final Collection operationsBatch; synchronized (queuedTxOperations) { if (queuedTxOperations.isEmpty()) { // We're done invoking the TransactionOperations so we can now publish the // TransactionContext. localTransactionContext.operationHandOffComplete(); - if (!localTransactionContext.usesOperationLimiting()){ + if (!localTransactionContext.usesOperationLimiting()) { limiter.releaseAll(); } transactionContext = localTransactionContext; diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterChangeListenerReply.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterChangeListenerReply.java index cc594ca200..f7031e4e37 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterChangeListenerReply.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterChangeListenerReply.java @@ -11,7 +11,7 @@ package org.opendaylight.controller.cluster.datastore.messages; import akka.actor.ActorPath; import akka.actor.ActorRef; -public class RegisterChangeListenerReply{ +public class RegisterChangeListenerReply { private final ActorRef listenerRegistration; public RegisterChangeListenerReply(final ActorRef listenerRegistration) {