Promote BucketStoreAccess 51/103051/3
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 3 Nov 2022 02:35:17 +0000 (03:35 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 3 Nov 2022 10:10:37 +0000 (11:10 +0100)
This is no longer @Beta.

Change-Id: I294085026f7306547230d476951793e09b3d0618
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/BucketStoreAccess.java

index e06e5fb15bfaf38cb7b522eb9f57efe3d6920c75..efbd63cd211ab4548252715530c313b484ef04d6 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.controller.remote.rpc.registry.gossip;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreActor.getBucketsByMembersMessage;
 import static org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreActor.getLocalDataMessage;
 import static org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreActor.getRemoteBucketsMessage;
@@ -18,21 +19,16 @@ import akka.actor.Address;
 import akka.dispatch.OnComplete;
 import akka.pattern.Patterns;
 import akka.util.Timeout;
-import com.google.common.annotations.Beta;
 import com.google.common.annotations.VisibleForTesting;
 import java.util.Collection;
 import java.util.Map;
-import java.util.Objects;
 import java.util.function.Consumer;
 import scala.concurrent.ExecutionContext;
 import scala.concurrent.Future;
 
 /**
  * Convenience access to {@link BucketStoreActor}. Used mostly by {@link Gossiper}.
- *
- * @author Robert Varga
  */
-@Beta
 @VisibleForTesting
 public final class BucketStoreAccess {
     private final ActorRef actorRef;
@@ -40,15 +36,15 @@ public final class BucketStoreAccess {
     private final Timeout timeout;
 
     public BucketStoreAccess(final ActorRef actorRef, final ExecutionContext dispatcher, final Timeout timeout) {
-        this.actorRef = Objects.requireNonNull(actorRef);
-        this.dispatcher = Objects.requireNonNull(dispatcher);
-        this.timeout = Objects.requireNonNull(timeout);
+        this.actorRef = requireNonNull(actorRef);
+        this.dispatcher = requireNonNull(dispatcher);
+        this.timeout = requireNonNull(timeout);
     }
 
     <T extends BucketData<T>> void getBucketsByMembers(final Collection<Address> members,
             final Consumer<Map<Address, Bucket<T>>> callback) {
         Patterns.ask(actorRef, getBucketsByMembersMessage(members), timeout)
-            .onComplete(new OnComplete<Object>() {
+            .onComplete(new OnComplete<>() {
                 @SuppressWarnings("unchecked")
                 @Override
                 public void onComplete(final Throwable failure, final Object success) {
@@ -60,7 +56,7 @@ public final class BucketStoreAccess {
     }
 
     void getBucketVersions(final Consumer<Map<Address, Long>> callback) {
-        Patterns.ask(actorRef, Singletons.GET_BUCKET_VERSIONS, timeout).onComplete(new OnComplete<Object>() {
+        Patterns.ask(actorRef, Singletons.GET_BUCKET_VERSIONS, timeout).onComplete(new OnComplete<>() {
             @SuppressWarnings("unchecked")
             @Override
             public void onComplete(final Throwable failure, final Object success) {
@@ -96,9 +92,13 @@ public final class BucketStoreAccess {
     }
 
     public enum Singletons {
-        // Sent from Gossiper to BucketStore, response is an immutable Map<Address, Bucket<?>>
+        /**
+         * Sent from Gossiper to BucketStore, response is an immutable {@code Map&lt;Address, Bucket&lt;?&gt;&gt;}.
+         */
         GET_ALL_BUCKETS,
-        // Sent from Gossiper to BucketStore, response is an immutable Map<Address, Long>
+        /**
+         * Sent from Gossiper to BucketStore, response is an immutable {@code Map&lt;Address, Long&gt;}.
+         */
         GET_BUCKET_VERSIONS,
     }
 }