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=4f7d68ea52861ae923212d4c8aa13668ae00b473;hp=7b91705bf3f5a8e8492e53ff6e90f9de3c1cd772;hb=769ef0f950f2ed6cfc14d274e6a8edc583a36a96;hpb=d207a2f677545357095f2e5f145a5ecc8d3a60dd 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 7b91705bf3..4f7d68ea52 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,7 @@ package org.opendaylight.controller.cluster.datastore; import akka.util.Timeout; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Sets; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -69,6 +70,7 @@ public class DatastoreContext { private boolean writeOnlyTransactionOptimizationsEnabled = true; private long shardCommitQueueExpiryTimeoutInMillis = DEFAULT_SHARD_COMMIT_QUEUE_EXPIRY_TIMEOUT_IN_MS; private boolean transactionDebugContextEnabled = false; + private String shardManagerPersistenceId; public static Set getGlobalDatastoreTypes() { return globalDatastoreTypes; @@ -101,6 +103,7 @@ public class DatastoreContext { this.writeOnlyTransactionOptimizationsEnabled = other.writeOnlyTransactionOptimizationsEnabled; this.shardCommitQueueExpiryTimeoutInMillis = other.shardCommitQueueExpiryTimeoutInMillis; this.transactionDebugContextEnabled = other.transactionDebugContextEnabled; + this.shardManagerPersistenceId = shardManagerPersistenceId; setShardJournalRecoveryLogBatchSize(other.raftConfig.getJournalRecoveryLogBatchSize()); setSnapshotBatchCount(other.raftConfig.getSnapshotBatchCount()); @@ -177,6 +180,10 @@ public class DatastoreContext { return transactionCreationInitialRateLimit; } + public String getShardManagerPersistenceId() { + return shardManagerPersistenceId; + } + private void setPeerAddressResolver(PeerAddressResolver resolver) { raftConfig.setPeerAddressResolver(resolver); } @@ -422,6 +429,15 @@ public class DatastoreContext { return this; } + /** + * For unit tests only. + */ + @VisibleForTesting + public Builder shardManagerPersistenceId(String id) { + datastoreContext.shardManagerPersistenceId = id; + return this; + } + public DatastoreContext build() { datastoreContext.dataStoreProperties = InMemoryDOMDataStoreConfigProperties.create( maxShardDataChangeExecutorPoolSize, maxShardDataChangeExecutorQueueSize,