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=e14db0fe6abf34bd222c58c75b495c6cb4b96fba;hp=c269312c8dd0aab428ec19e6c3c21e82a6105051;hb=634dfac8eead60f443bf75e749c70d1f2bb29198;hpb=1d3c54640b9fff649fe8d0f57e20d56f8f936cc1 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 c269312c8d..e14db0fe6a 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 @@ -5,7 +5,6 @@ * 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.datastore; import akka.actor.ActorRef; @@ -37,17 +36,16 @@ public class DataTreeCohortRegistrationProxy @GuardedBy("this") private ActorRef cohortRegistry; - - DataTreeCohortRegistrationProxy(ActorContext actorContext, DOMDataTreeIdentifier subtree, C cohort) { + DataTreeCohortRegistrationProxy(final ActorContext actorContext, final DOMDataTreeIdentifier subtree, + final C cohort) { super(cohort); this.subtree = Preconditions.checkNotNull(subtree); this.actorContext = Preconditions.checkNotNull(actorContext); - this.actor = actorContext.getActorSystem().actorOf( - DataTreeCohortActor.props(getInstance()).withDispatcher(actorContext.getNotificationDispatcherPath())); + this.actor = actorContext.getActorSystem().actorOf(DataTreeCohortActor.props(getInstance(), + subtree.getRootIdentifier()).withDispatcher(actorContext.getNotificationDispatcherPath())); } - - public void init(String shardName) { + public void init(final String shardName) { // FIXME: Add late binding to shard. Future findFuture = actorContext.findLocalShardAsync(shardName); findFuture.onComplete(new OnComplete() { @@ -58,7 +56,7 @@ public class DataTreeCohortRegistrationProxy + "cannot be registered", shardName, getInstance(), subtree); } else if (failure != null) { LOG.error("Failed to find local shard {} - DataTreeChangeListener {} at path {} " - + "cannot be registered: {}", shardName, getInstance(), subtree, failure); + + "cannot be registered", shardName, getInstance(), subtree, failure); } else { performRegistration(shard); } @@ -66,7 +64,7 @@ public class DataTreeCohortRegistrationProxy }, actorContext.getClientDispatcher()); } - private synchronized void performRegistration(ActorRef shard) { + private synchronized void performRegistration(final ActorRef shard) { if (isClosed()) { return; } @@ -76,9 +74,9 @@ public class DataTreeCohortRegistrationProxy future.onComplete(new OnComplete() { @Override - public void onComplete(Throwable e, Object val) throws Throwable { - if (e != null) { - LOG.error("Unable to register {} as commit cohort", getInstance(), e); + public void onComplete(final Throwable failure, final Object val) { + if (failure != null) { + LOG.error("Unable to register {} as commit cohort", getInstance(), failure); } if (isClosed()) { removeRegistration();