Import scala.concurrent.Future 74/85374/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 24 Oct 2019 15:49:08 +0000 (17:49 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 24 Oct 2019 15:52:01 +0000 (17:52 +0200)
Since we are returning ListenableFuture from RPCs, we can freely
import Scala's Future and shorten references to it.

Change-Id: I77c911fa6d9eca5804547039715f3e57866bafcf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-cluster-admin-impl/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java

index adc059c..7e5c798 100644 (file)
@@ -109,6 +109,7 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import scala.concurrent.Future;
 
 /**
  * Implements the yang RPCs defined in the generated ClusterAdminService interface.
@@ -275,8 +276,7 @@ public class ClusterAdminRpcService implements ClusterAdminService {
         LOG.info("Moving leader to local node {} for shard {}, datastoreType {}",
                 actorUtils.getCurrentMemberName().getName(), shardName, dataStoreType);
 
-        final scala.concurrent.Future<ActorRef> localShardReply =
-                actorUtils.findLocalShardAsync(shardName);
+        final Future<ActorRef> localShardReply = actorUtils.findLocalShardAsync(shardName);
 
         final scala.concurrent.Promise<Object> makeLeaderLocalAsk = akka.dispatch.Futures.promise();
         localShardReply.onComplete(new OnComplete<ActorRef>() {
@@ -741,7 +741,7 @@ public class ClusterAdminRpcService implements ClusterAdminService {
         final SettableFuture<T> returnFuture = SettableFuture.create();
 
         @SuppressWarnings("unchecked")
-        scala.concurrent.Future<T> askFuture = (scala.concurrent.Future<T>) Patterns.ask(actor, message, timeout);
+        Future<T> askFuture = (Future<T>) Patterns.ask(actor, message, timeout);
         askFuture.onComplete(new OnComplete<T>() {
             @Override
             public void onComplete(final Throwable failure, final T resp) {

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.