X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fsharding%2FPrefixedShardConfigUpdateHandler.java;h=44b68a98052daeb5d7992833520c9a3d9ba1b95b;hp=1e66728aa4272f39439432c619cfd888faa2714c;hb=a35607c5040d0fd561529fde3032c9f49393deeb;hpb=3dc48592696e6a4535c0e125c1e23dbc62bc9091 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/PrefixedShardConfigUpdateHandler.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/PrefixedShardConfigUpdateHandler.java index 1e66728aa4..44b68a9805 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/PrefixedShardConfigUpdateHandler.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/PrefixedShardConfigUpdateHandler.java @@ -5,23 +5,21 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.controller.cluster.sharding; import static akka.actor.ActorRef.noSender; +import static java.util.Objects.requireNonNull; import static org.opendaylight.controller.cluster.datastore.utils.ClusterUtils.SHARD_PREFIX_QNAME; import static org.opendaylight.controller.cluster.datastore.utils.ClusterUtils.SHARD_REPLICAS_QNAME; import static org.opendaylight.controller.cluster.datastore.utils.ClusterUtils.SHARD_REPLICA_QNAME; import akka.actor.ActorRef; -import com.google.common.base.Preconditions; import java.util.Collection; import java.util.EnumMap; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.opendaylight.controller.cluster.access.concepts.MemberName; -import org.opendaylight.controller.cluster.datastore.AbstractDataStore; +import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface; import org.opendaylight.controller.cluster.datastore.config.PrefixShardConfiguration; import org.opendaylight.controller.cluster.datastore.shardstrategy.PrefixShardStrategy; import org.opendaylight.controller.cluster.datastore.utils.ClusterUtils; @@ -48,6 +46,7 @@ import org.slf4j.LoggerFactory; * notifies handling actor with {@link PrefixShardCreated} and * {@link PrefixShardRemoved} messages. */ +@Deprecated(forRemoval = true) public class PrefixedShardConfigUpdateHandler { private static final Logger LOG = LoggerFactory.getLogger(PrefixedShardConfigUpdateHandler.class); @@ -58,11 +57,11 @@ public class PrefixedShardConfigUpdateHandler { new EnumMap<>(LogicalDatastoreType.class); public PrefixedShardConfigUpdateHandler(final ActorRef handlingActor, final MemberName memberName) { - this.handlingActor = Preconditions.checkNotNull(handlingActor); - this.memberName = Preconditions.checkNotNull(memberName); + this.handlingActor = requireNonNull(handlingActor); + this.memberName = requireNonNull(memberName); } - public void initListener(final AbstractDataStore dataStore, final LogicalDatastoreType type) { + public void initListener(final DistributedDataStoreInterface dataStore, final LogicalDatastoreType type) { registrations.put(type, dataStore.registerShardConfigListener( ClusterUtils.SHARD_LIST_PATH, new ShardConfigHandler(memberName, type, handlingActor))); } @@ -89,7 +88,7 @@ public class PrefixedShardConfigUpdateHandler { } @Override - public void onDataTreeChanged(@Nonnull final Collection changes) { + public void onDataTreeChanged(final Collection changes) { changes.forEach(this::resolveChange); }