* 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;
* 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);
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)));
}
}
@Override
- public void onDataTreeChanged(@Nonnull final Collection<DataTreeCandidate> changes) {
+ public void onDataTreeChanged(final Collection<DataTreeCandidate> changes) {
changes.forEach(this::resolveChange);
}