import org.opendaylight.controller.cluster.common.actor.FileAkkaConfigurationReader;
import org.opendaylight.controller.cluster.raft.ConfigParams;
import org.opendaylight.controller.cluster.raft.DefaultConfigParamsImpl;
+import org.opendaylight.controller.cluster.raft.PeerAddressResolver;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties;
import scala.concurrent.duration.Duration;
import scala.concurrent.duration.FiniteDuration;
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<String> getGlobalDatastoreTypes() {
return globalDatastoreTypes;
this.writeOnlyTransactionOptimizationsEnabled = other.writeOnlyTransactionOptimizationsEnabled;
this.shardCommitQueueExpiryTimeoutInMillis = other.shardCommitQueueExpiryTimeoutInMillis;
this.transactionDebugContextEnabled = other.transactionDebugContextEnabled;
- this.customRaftPolicyImplementation = other.customRaftPolicyImplementation;
setShardJournalRecoveryLogBatchSize(other.raftConfig.getJournalRecoveryLogBatchSize());
setSnapshotBatchCount(other.raftConfig.getSnapshotBatchCount());
setIsolatedLeaderCheckInterval(other.raftConfig.getIsolatedCheckIntervalInMillis());
setSnapshotDataThresholdPercentage(other.raftConfig.getSnapshotDataThresholdPercentage());
setElectionTimeoutFactor(other.raftConfig.getElectionTimeoutFactor());
- setCustomRaftPolicyImplementation(other.customRaftPolicyImplementation);
+ setCustomRaftPolicyImplementation(other.raftConfig.getCustomRaftPolicyImplementationClass());
setShardSnapshotChunkSize(other.raftConfig.getSnapshotChunkSize());
-
+ setPeerAddressResolver(other.raftConfig.getPeerAddressResolver());
}
public static Builder newBuilder() {
return transactionCreationInitialRateLimit;
}
+ private void setPeerAddressResolver(PeerAddressResolver resolver) {
+ raftConfig.setPeerAddressResolver(resolver);
+ }
+
private void setHeartbeatInterval(long shardHeartbeatIntervalInMillis){
raftConfig.setHeartBeatInterval(new FiniteDuration(shardHeartbeatIntervalInMillis,
TimeUnit.MILLISECONDS));
raftConfig.setCustomRaftPolicyImplementationClass(customRaftPolicyImplementation);
}
-
private void setSnapshotDataThresholdPercentage(int shardSnapshotDataThresholdPercentage) {
raftConfig.setSnapshotDataThresholdPercentage(shardSnapshotDataThresholdPercentage);
}
raftConfig.setSnapshotBatchCount(shardSnapshotBatchCount);
}
+ private void setShardSnapshotChunkSize(int shardSnapshotChunkSize) {
+ raftConfig.setSnapshotChunkSize(shardSnapshotChunkSize);
+ }
+
public int getShardBatchedModificationCount() {
return shardBatchedModificationCount;
}
return raftConfig.getSnapshotChunkSize();
}
- public void setShardSnapshotChunkSize(int shardSnapshotChunkSize) {
- raftConfig.setSnapshotChunkSize(shardSnapshotChunkSize);
- }
-
public static class Builder {
private final DatastoreContext datastoreContext;
private int maxShardDataChangeExecutorPoolSize =
datastoreContext.setShardSnapshotChunkSize(shardSnapshotChunkSize);
return this;
}
+
+ public Builder shardPeerAddressResolver(PeerAddressResolver resolver) {
+ datastoreContext.setPeerAddressResolver(resolver);
+ return this;
+ }
}
}