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=eeb6ad3155e2bc91d9e910728d589cca2084603b;hp=a81806bc1086b66ff4400ced5e6d5355dc2be30a;hb=ef3b9a8300db1c791f2c4088d39152ccf9f5b97c;hpb=5370e8be094b802caa732efb4da5a035c53dc9c6 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 a81806bc10..eeb6ad3155 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 @@ -76,6 +76,7 @@ public class DatastoreContext { private int shardBatchedModificationCount = DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT; private boolean writeOnlyTransactionOptimizationsEnabled = true; private long shardCommitQueueExpiryTimeoutInMillis = DEFAULT_SHARD_COMMIT_QUEUE_EXPIRY_TIMEOUT_IN_MS; + private boolean useTellBasedProtocol = false; private boolean transactionDebugContextEnabled = false; private String shardManagerPersistenceId; @@ -113,6 +114,7 @@ public class DatastoreContext { this.shardCommitQueueExpiryTimeoutInMillis = other.shardCommitQueueExpiryTimeoutInMillis; this.transactionDebugContextEnabled = other.transactionDebugContextEnabled; this.shardManagerPersistenceId = other.shardManagerPersistenceId; + this.useTellBasedProtocol = other.useTellBasedProtocol; setShardJournalRecoveryLogBatchSize(other.raftConfig.getJournalRecoveryLogBatchSize()); setSnapshotBatchCount(other.raftConfig.getSnapshotBatchCount()); @@ -123,6 +125,8 @@ public class DatastoreContext { setCustomRaftPolicyImplementation(other.raftConfig.getCustomRaftPolicyImplementationClass()); setShardSnapshotChunkSize(other.raftConfig.getSnapshotChunkSize()); setPeerAddressResolver(other.raftConfig.getPeerAddressResolver()); + setTempFileDirectory(other.getTempFileDirectory()); + setFileBackedStreamingThreshold(other.getFileBackedStreamingThreshold()); } public static Builder newBuilder() { @@ -201,6 +205,22 @@ public class DatastoreContext { return shardManagerPersistenceId; } + public String getTempFileDirectory() { + return raftConfig.getTempFileDirectory(); + } + + private void setTempFileDirectory(String tempFileDirectory) { + raftConfig.setTempFileDirectory(tempFileDirectory); + } + + public int getFileBackedStreamingThreshold() { + return raftConfig.getFileBackedStreamingThreshold(); + } + + private void setFileBackedStreamingThreshold(int fileBackedStreamingThreshold) { + raftConfig.setFileBackedStreamingThreshold(fileBackedStreamingThreshold); + } + private void setPeerAddressResolver(PeerAddressResolver resolver) { raftConfig.setPeerAddressResolver(resolver); } @@ -258,6 +278,10 @@ public class DatastoreContext { return transactionDebugContextEnabled; } + public boolean isUseTellBasedProtocol() { + return useTellBasedProtocol; + } + public int getShardSnapshotChunkSize() { return raftConfig.getSnapshotChunkSize(); } @@ -471,6 +495,11 @@ public class DatastoreContext { return this; } + public Builder useTellBasedProtocol(boolean value) { + datastoreContext.useTellBasedProtocol = value; + return this; + } + /** * For unit tests only. */ @@ -506,5 +535,15 @@ public class DatastoreContext { datastoreContext.setPeerAddressResolver(resolver); return this; } + + public Builder tempFileDirectory(String tempFileDirectory) { + datastoreContext.setTempFileDirectory(tempFileDirectory); + return this; + } + + public Builder fileBackedStreamingThresholdInMegabytes(int fileBackedStreamingThreshold) { + datastoreContext.setFileBackedStreamingThreshold(fileBackedStreamingThreshold * ConfigParams.MEGABYTE); + return this; + } } }