2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.cluster.datastore;
11 import akka.actor.ActorSystem;
13 import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategyFactory;
14 import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties;
15 import org.opendaylight.controller.sal.core.api.model.SchemaService;
17 public class DistributedDataStoreFactory {
18 public static DistributedDataStore createInstance(String name, SchemaService schemaService,
19 InMemoryDOMDataStoreConfigProperties dataStoreProperties) {
21 ActorSystem actorSystem = ActorSystemFactory.getInstance();
22 Configuration config = new ConfigurationImpl("module-shards.conf", "modules.conf");
23 final DistributedDataStore dataStore =
24 new DistributedDataStore(actorSystem, name, new ClusterWrapperImpl(actorSystem),
25 config, dataStoreProperties );
26 ShardStrategyFactory.setConfiguration(config);
27 schemaService.registerSchemaContextListener(dataStore);