1 package org.opendaylight.controller.config.yang.config.distributed_datastore_provider;
3 import java.util.concurrent.TimeUnit;
5 import org.opendaylight.controller.cluster.datastore.DatastoreContext;
6 import org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory;
7 import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties;
8 import org.osgi.framework.BundleContext;
10 import scala.concurrent.duration.Duration;
12 public class DistributedConfigDataStoreProviderModule extends
13 org.opendaylight.controller.config.yang.config.distributed_datastore_provider.AbstractDistributedConfigDataStoreProviderModule {
14 private BundleContext bundleContext;
16 public DistributedConfigDataStoreProviderModule(
17 org.opendaylight.controller.config.api.ModuleIdentifier identifier,
18 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
19 super(identifier, dependencyResolver);
22 public DistributedConfigDataStoreProviderModule(
23 org.opendaylight.controller.config.api.ModuleIdentifier identifier,
24 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
25 org.opendaylight.controller.config.yang.config.distributed_datastore_provider.DistributedConfigDataStoreProviderModule oldModule,
26 java.lang.AutoCloseable oldInstance) {
27 super(identifier, dependencyResolver, oldModule, oldInstance);
31 public void customValidation() {
32 // add custom validation form module attributes here.
36 public java.lang.AutoCloseable createInstance() {
38 ConfigProperties props = getConfigProperties();
40 props = new ConfigProperties();
43 DatastoreContext datastoreContext = new DatastoreContext("DistributedConfigDatastore",
44 InMemoryDOMDataStoreConfigProperties.create(
45 props.getMaxShardDataChangeExecutorPoolSize().getValue().intValue(),
46 props.getMaxShardDataChangeExecutorQueueSize().getValue().intValue(),
47 props.getMaxShardDataChangeListenerQueueSize().getValue().intValue(),
48 props.getMaxShardDataStoreExecutorQueueSize().getValue().intValue()),
49 Duration.create(props.getShardTransactionIdleTimeoutInMinutes().getValue(),
51 props.getOperationTimeoutInSeconds().getValue(),
52 props.getShardJournalRecoveryLogBatchSize().getValue().intValue(),
53 props.getShardSnapshotBatchCount().getValue().intValue(),
54 props.getShardHearbeatIntervalInMillis().getValue());
56 return DistributedDataStoreFactory.createInstance("config", getConfigSchemaServiceDependency(),
57 datastoreContext, bundleContext);
60 public void setBundleContext(BundleContext bundleContext) {
61 this.bundleContext = bundleContext;