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%2FDatastoreContext.java;h=26d1a6eb97a82abdcee1bd8ddcf73ecc606ab2fc;hb=30507b196fa240a4176ba12102ac0469280feff9;hp=a7e21e8ae7a3e17f31551aad408713978d1f43ea;hpb=4dfc97c7a407e87716823ca846218bd21131dbd5;p=controller.git 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 a7e21e8ae7..26d1a6eb97 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 @@ -67,6 +67,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 customRaftPolicyImplementation = ""; public static Set getGlobalDatastoreTypes() { return globalDatastoreTypes; @@ -98,6 +99,7 @@ public class DatastoreContext { this.writeOnlyTransactionOptimizationsEnabled = other.writeOnlyTransactionOptimizationsEnabled; this.shardCommitQueueExpiryTimeoutInMillis = other.shardCommitQueueExpiryTimeoutInMillis; this.transactionDebugContextEnabled = other.transactionDebugContextEnabled; + this.customRaftPolicyImplementation = other.customRaftPolicyImplementation; setShardJournalRecoveryLogBatchSize(other.raftConfig.getJournalRecoveryLogBatchSize()); setSnapshotBatchCount(other.raftConfig.getSnapshotBatchCount()); @@ -105,6 +107,8 @@ public class DatastoreContext { setIsolatedLeaderCheckInterval(other.raftConfig.getIsolatedCheckIntervalInMillis()); setSnapshotDataThresholdPercentage(other.raftConfig.getSnapshotDataThresholdPercentage()); setElectionTimeoutFactor(other.raftConfig.getElectionTimeoutFactor()); + setCustomRaftPolicyImplementation(other.customRaftPolicyImplementation); + } public static Builder newBuilder() { @@ -190,6 +194,11 @@ public class DatastoreContext { raftConfig.setElectionTimeoutFactor(shardElectionTimeoutFactor); } + private void setCustomRaftPolicyImplementation(String customRaftPolicyImplementation) { + raftConfig.setCustomRaftPolicyImplementationClass(customRaftPolicyImplementation); + } + + private void setSnapshotDataThresholdPercentage(int shardSnapshotDataThresholdPercentage) { raftConfig.setSnapshotDataThresholdPercentage(shardSnapshotDataThresholdPercentage); } @@ -411,5 +420,10 @@ public class DatastoreContext { return datastoreContext; } + + public Builder customRaftPolicyImplementation(String customRaftPolicyImplementation) { + datastoreContext.setCustomRaftPolicyImplementation(customRaftPolicyImplementation); + return this; + } } }