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%2FDatastoreContext.java;h=c3cc4998656e82b37354500a1b629534c5622abe;hp=d5142c94a68b53311293de80cf5fc73d9415ed9b;hb=08dd5c2c443ff53f56af88a0e8dc8f34e36d2245;hpb=75be58eb52cbb3846814d536f16d7829e26b95d8 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java index d5142c94a6..c3cc499865 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java @@ -9,6 +9,8 @@ package org.opendaylight.controller.cluster.datastore; import akka.util.Timeout; +import com.google.common.collect.Sets; +import java.util.Set; import java.util.concurrent.TimeUnit; import org.apache.commons.lang3.text.WordUtils; import org.opendaylight.controller.cluster.datastore.config.ConfigurationReader; @@ -25,6 +27,7 @@ import scala.concurrent.duration.FiniteDuration; * @author Thomas Pantelis */ public class DatastoreContext { + public static final String METRICS_DOMAIN = "org.opendaylight.controller.cluster.datastore"; public static final Duration DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT = Duration.create(10, TimeUnit.MINUTES); public static final int DEFAULT_OPERATION_TIMEOUT_IN_SECONDS = 5; @@ -44,6 +47,8 @@ public class DatastoreContext { public static final String UNKNOWN_DATA_STORE_TYPE = "unknown"; public static final int DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT= 100; + private static Set globalDatastoreTypes = Sets.newConcurrentHashSet(); + private InMemoryDOMDataStoreConfigProperties dataStoreProperties; private Duration shardTransactionIdleTimeout = DatastoreContext.DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT; private int operationTimeoutInSeconds = DEFAULT_OPERATION_TIMEOUT_IN_SECONDS; @@ -60,6 +65,10 @@ public class DatastoreContext { private int shardBatchedModificationCount = DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT; private boolean writeOnlyTransactionOptimizationsEnabled = false; + public static Set getGlobalDatastoreTypes() { + return globalDatastoreTypes; + } + private DatastoreContext() { setShardJournalRecoveryLogBatchSize(DEFAULT_JOURNAL_RECOVERY_BATCH_SIZE); setSnapshotBatchCount(DEFAULT_SNAPSHOT_BATCH_COUNT); @@ -361,6 +370,11 @@ public class DatastoreContext { datastoreContext.dataStoreProperties = InMemoryDOMDataStoreConfigProperties.create( maxShardDataChangeExecutorPoolSize, maxShardDataChangeExecutorQueueSize, maxShardDataChangeListenerQueueSize, maxShardDataStoreExecutorQueueSize); + + if(datastoreContext.dataStoreType != null) { + globalDatastoreTypes.add(datastoreContext.dataStoreType); + } + return datastoreContext; } }