X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fshardmanager%2FAbstractShardManagerCreator.java;h=560b5344b0052bd09e455b396780cc5579211097;hb=b5d01b5d28d52413bf45b626b746c1519685058c;hp=0285b264c48a50201159c22adb96dee876e2ec1f;hpb=3859df9beca8f13f1ff2b2744ed3470a1715bec3;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/shardmanager/AbstractShardManagerCreator.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/shardmanager/AbstractShardManagerCreator.java index 0285b264c4..560b5344b0 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/shardmanager/AbstractShardManagerCreator.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/shardmanager/AbstractShardManagerCreator.java @@ -11,20 +11,21 @@ import static com.google.common.base.Preconditions.checkState; import static java.util.Objects.requireNonNull; import akka.actor.Props; -import java.util.concurrent.CountDownLatch; +import com.google.common.util.concurrent.SettableFuture; import org.opendaylight.controller.cluster.datastore.AbstractDataStore; import org.opendaylight.controller.cluster.datastore.ClusterWrapper; import org.opendaylight.controller.cluster.datastore.DatastoreContextFactory; import org.opendaylight.controller.cluster.datastore.config.Configuration; import org.opendaylight.controller.cluster.datastore.persisted.DatastoreSnapshot; import org.opendaylight.controller.cluster.datastore.utils.PrimaryShardInfoFutureCache; +import org.opendaylight.yangtools.yang.common.Empty; public abstract class AbstractShardManagerCreator> { + private SettableFuture readinessFuture; private ClusterWrapper cluster; private Configuration configuration; private DatastoreContextFactory datastoreContextFactory; private AbstractDataStore distributedDataStore; - private CountDownLatch waitTillReadyCountDownLatch; private PrimaryShardInfoFutureCache primaryShardInfoCache; private DatastoreSnapshot restoreFromSnapshot; private volatile boolean sealed; @@ -82,13 +83,13 @@ public abstract class AbstractShardManagerCreator getReadinessFuture() { + return readinessFuture; } - public T waitTillReadyCountDownLatch(final CountDownLatch newWaitTillReadyCountDownLatch) { + public T readinessFuture(final SettableFuture newReadinessFuture) { checkSealed(); - this.waitTillReadyCountDownLatch = newWaitTillReadyCountDownLatch; + this.readinessFuture = newReadinessFuture; return self(); } @@ -118,7 +119,7 @@ public abstract class AbstractShardManagerCreator