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%2FDistributedDataStoreFactory.java;h=8739ed1966b618a3843c8e23e5671ea05eb48f15;hb=35f74293edf98402e2b622e060185f7874d10857;hp=f19cb9284cf3ecd81cbe2672c731db3d80af0d3a;hpb=492324f1b08f853084217c3fa8b628f551bb81ad;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreFactory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreFactory.java index f19cb9284c..8739ed1966 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreFactory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreFactory.java @@ -8,15 +8,23 @@ package org.opendaylight.controller.cluster.datastore; +import akka.actor.ActorSystem; + +import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategyFactory; import org.opendaylight.controller.sal.core.api.model.SchemaService; +import org.osgi.framework.BundleContext; public class DistributedDataStoreFactory { - public static DistributedDataStore createInstance(String name, SchemaService schemaService){ + public static DistributedDataStore createInstance(String name, SchemaService schemaService, + DatastoreContext datastoreContext, BundleContext bundleContext) { + + ActorSystem actorSystem = ActorSystemFactory.createInstance(bundleContext); + Configuration config = new ConfigurationImpl("module-shards.conf", "modules.conf"); final DistributedDataStore dataStore = - new DistributedDataStore(ActorSystemFactory.getInstance(), name); - schemaService - .registerSchemaServiceListener(dataStore); + new DistributedDataStore(actorSystem, name, new ClusterWrapperImpl(actorSystem), + config, datastoreContext ); + ShardStrategyFactory.setConfiguration(config); + schemaService.registerSchemaContextListener(dataStore); return dataStore; - } }