From: Robert Varga Date: Thu, 24 Oct 2019 15:49:08 +0000 (+0200) Subject: Import scala.concurrent.Future X-Git-Tag: release/magnesium~36 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=ed07cf4822772febeb46d4f36b5d84e6574eeb87 Import scala.concurrent.Future 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 --- diff --git a/opendaylight/md-sal/sal-cluster-admin-impl/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java b/opendaylight/md-sal/sal-cluster-admin-impl/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java index adc059c14e..7e5c798e82 100644 --- a/opendaylight/md-sal/sal-cluster-admin-impl/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java +++ b/opendaylight/md-sal/sal-cluster-admin-impl/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java @@ -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 localShardReply = - actorUtils.findLocalShardAsync(shardName); + final Future localShardReply = actorUtils.findLocalShardAsync(shardName); final scala.concurrent.Promise makeLeaderLocalAsk = akka.dispatch.Futures.promise(); localShardReply.onComplete(new OnComplete() { @@ -741,7 +741,7 @@ public class ClusterAdminRpcService implements ClusterAdminService { final SettableFuture returnFuture = SettableFuture.create(); @SuppressWarnings("unchecked") - scala.concurrent.Future askFuture = (scala.concurrent.Future) Patterns.ask(actor, message, timeout); + Future askFuture = (Future) Patterns.ask(actor, message, timeout); askFuture.onComplete(new OnComplete() { @Override public void onComplete(final Throwable failure, final T resp) {