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%2Fdatastore%2FDataTreeCohortRegistrationProxy.java;h=8012a2dcb70817ff604516dbeca499cee984b643;hp=e5f4ceaa7e105770545d9be6f3951f3e34e39c44;hb=HEAD;hpb=14c92df74247c884a43c5aaea2f154992b0ec798 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortRegistrationProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortRegistrationProxy.java index e5f4ceaa7e..4e3c6cb8d7 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortRegistrationProxy.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortRegistrationProxy.java @@ -13,13 +13,11 @@ import akka.actor.ActorRef; import akka.dispatch.OnComplete; import akka.pattern.Patterns; import akka.util.Timeout; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.concurrent.TimeUnit; import org.checkerframework.checker.lock.qual.GuardedBy; import org.opendaylight.controller.cluster.datastore.exceptions.LocalShardNotFoundException; import org.opendaylight.controller.cluster.datastore.utils.ActorUtils; import org.opendaylight.mdsal.dom.api.DOMDataTreeCommitCohort; -import org.opendaylight.mdsal.dom.api.DOMDataTreeCommitCohortRegistration; import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier; import org.opendaylight.yangtools.concepts.AbstractObjectRegistration; import org.slf4j.Logger; @@ -27,11 +25,10 @@ import org.slf4j.LoggerFactory; import scala.concurrent.Future; import scala.concurrent.duration.FiniteDuration; -public class DataTreeCohortRegistrationProxy extends AbstractObjectRegistration - implements DOMDataTreeCommitCohortRegistration { - +public class DataTreeCohortRegistrationProxy extends AbstractObjectRegistration { private static final Logger LOG = LoggerFactory.getLogger(DataTreeCohortRegistrationProxy.class); private static final Timeout TIMEOUT = new Timeout(new FiniteDuration(5, TimeUnit.SECONDS)); + private final DOMDataTreeIdentifier subtree; private final ActorRef actor; private final ActorUtils actorUtils; @@ -43,8 +40,8 @@ public class DataTreeCohortRegistrationProxy super(cohort); this.subtree = requireNonNull(subtree); this.actorUtils = requireNonNull(actorUtils); - this.actor = actorUtils.getActorSystem().actorOf(DataTreeCohortActor.props(getInstance(), - subtree.getRootIdentifier()).withDispatcher(actorUtils.getNotificationDispatcherPath())); + actor = actorUtils.getActorSystem().actorOf(DataTreeCohortActor.props(getInstance(), + subtree.path()).withDispatcher(actorUtils.getNotificationDispatcherPath())); } public void init(final String shardName) { @@ -66,8 +63,6 @@ public class DataTreeCohortRegistrationProxy }, actorUtils.getClientDispatcher()); } - @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD", - justification = "https://github.com/spotbugs/spotbugs/issues/811") private synchronized void performRegistration(final ActorRef shard) { if (isClosed()) { return; @@ -75,7 +70,7 @@ public class DataTreeCohortRegistrationProxy cohortRegistry = shard; Future future = Patterns.ask(shard, new DataTreeCohortActorRegistry.RegisterCohort(subtree, actor), TIMEOUT); - future.onComplete(new OnComplete() { + future.onComplete(new OnComplete<>() { @Override public void onComplete(final Throwable failure, final Object val) {