Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Remove EmptyExternalizableProxy
[controller.git]
/
opendaylight
/
md-sal
/
sal-akka-raft
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
raft
/
DefaultConfigParamsImpl.java
diff --git
a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java
b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java
index 97838b03212f8ea8b3fbd6201995b398a9b61977..0d65fa2ea1272a9ee77567cc493c7bd464b9ba27 100644
(file)
--- a/
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java
+++ b/
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java
@@
-41,7
+41,7
@@
public class DefaultConfigParamsImpl implements ConfigParams {
*/
private static final int ELECTION_TIME_MAX_VARIANCE = 100;
*/
private static final int ELECTION_TIME_MAX_VARIANCE = 100;
- private static final int SNAPSHOT_CHUNK_SIZE =
2048 * 1000; //2M
B
+ private static final int SNAPSHOT_CHUNK_SIZE =
480 * 1024; // 480Ki
B
/**
/**
@@
-68,6
+68,10
@@
public class DefaultConfigParamsImpl implements ConfigParams {
// in-memory journal can use before it needs to snapshot
private int snapshotDataThresholdPercentage = 12;
// in-memory journal can use before it needs to snapshot
private int snapshotDataThresholdPercentage = 12;
+ // max size of in-memory journal in MB
+ // 0 means direct threshold if disabled
+ private int snapshotDataThreshold = 0;
+
private int snapshotChunkSize = SNAPSHOT_CHUNK_SIZE;
private long electionTimeoutFactor = 2;
private int snapshotChunkSize = SNAPSHOT_CHUNK_SIZE;
private long electionTimeoutFactor = 2;
@@
-91,15
+95,19
@@
public class DefaultConfigParamsImpl implements ConfigParams {
this.snapshotBatchCount = snapshotBatchCount;
}
this.snapshotBatchCount = snapshotBatchCount;
}
- public void setRecoverySnapshotIntervalSeconds(int recoverySnapshotInterval) {
+ public void setRecoverySnapshotIntervalSeconds(
final
int recoverySnapshotInterval) {
checkArgument(recoverySnapshotInterval >= 0);
checkArgument(recoverySnapshotInterval >= 0);
-
this.
recoverySnapshotIntervalSeconds = recoverySnapshotInterval;
+ recoverySnapshotIntervalSeconds = recoverySnapshotInterval;
}
public void setSnapshotDataThresholdPercentage(final int snapshotDataThresholdPercentage) {
this.snapshotDataThresholdPercentage = snapshotDataThresholdPercentage;
}
}
public void setSnapshotDataThresholdPercentage(final int snapshotDataThresholdPercentage) {
this.snapshotDataThresholdPercentage = snapshotDataThresholdPercentage;
}
+ public void setSnapshotDataThreshold(final int snapshotDataThreshold) {
+ this.snapshotDataThreshold = snapshotDataThreshold;
+ }
+
public void setSnapshotChunkSize(final int snapshotChunkSize) {
this.snapshotChunkSize = snapshotChunkSize;
}
public void setSnapshotChunkSize(final int snapshotChunkSize) {
this.snapshotChunkSize = snapshotChunkSize;
}
@@
-148,9
+156,14
@@
public class DefaultConfigParamsImpl implements ConfigParams {
return snapshotDataThresholdPercentage;
}
return snapshotDataThresholdPercentage;
}
+ @Override
+ public int getSnapshotDataThreshold() {
+ return snapshotDataThreshold;
+ }
+
@Override
public int getRecoverySnapshotIntervalSeconds() {
@Override
public int getRecoverySnapshotIntervalSeconds() {
- return
this.
recoverySnapshotIntervalSeconds;
+ return recoverySnapshotIntervalSeconds;
}
@Override
}
@Override