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%2FDistributedDataStore.java;h=0c4fae0fc68c098e7f2f9e2daa4eba62828a1f20;hb=98f72d6e38e62500bbad181acf522511d384565c;hp=3c12fa6e86158aed9579b245f3a418b1d9df87b3;hpb=321d959d82bf14a6826e5bf42419c1a1460a1cbc;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStore.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStore.java index 3c12fa6e86..0c4fae0fc6 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStore.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStore.java @@ -13,6 +13,7 @@ import akka.actor.ActorSystem; import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListener; import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListenerReply; import org.opendaylight.controller.cluster.datastore.messages.UpdateSchemaContext; +import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategyFactory; import org.opendaylight.controller.cluster.datastore.utils.ActorContext; import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker; import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener; @@ -59,8 +60,8 @@ public class DistributedDataStore implements DOMStore, SchemaContextListener, Au private final ExecutorService executor = Executors.newFixedThreadPool(10); - public DistributedDataStore(ActorSystem actorSystem, String type) { - this(new ActorContext(actorSystem, actorSystem.actorOf(ShardManager.props(type), "shardmanager-" + type)), type); + public DistributedDataStore(ActorSystem actorSystem, String type, ClusterWrapper cluster, Configuration configuration) { + this(new ActorContext(actorSystem, actorSystem.actorOf(ShardManager.props(type, cluster, configuration), "shardmanager-" + type), configuration), type); } public DistributedDataStore(ActorContext actorContext, String type) { @@ -77,7 +78,9 @@ public class DistributedDataStore implements DOMStore, SchemaContextListener, Au ActorRef dataChangeListenerActor = actorContext.getActorSystem().actorOf( DataChangeListener.props(listener)); - Object result = actorContext.executeShardOperation(Shard.DEFAULT_NAME, + String shardName = ShardStrategyFactory.getStrategy(path).findShard(path); + + Object result = actorContext.executeShardOperation(shardName, new RegisterChangeListener(path, dataChangeListenerActor.path(), AsyncDataBroker.DataChangeScope.BASE).toSerializable(), ActorContext.ASK_DURATION