DatabaseManager: larger raft log size limit
Change-Id: Ib93b11ce55d9c038fad8e4fabfa8efc089899656
diff --git a/core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java b/core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java
index 35b6c98..e9fdb48 100644
--- a/core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java
+++ b/core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java
@@ -17,6 +17,7 @@
import java.util.concurrent.TimeUnit;
import net.kuujo.copycat.Copycat;
+import net.kuujo.copycat.CopycatConfig;
import net.kuujo.copycat.cluster.ClusterConfig;
import net.kuujo.copycat.cluster.Member;
import net.kuujo.copycat.cluster.TcpCluster;
@@ -116,6 +117,9 @@
private volatile LeaderElectEvent myLeaderEvent = null;
+ // TODO make this configuratble
+ private int maxLogSizeBytes = 128 * (1024 ^ 2);
+
@Activate
public void activate() throws InterruptedException, ExecutionException {
@@ -175,7 +179,10 @@
Log consensusLog = new MapDBLog(LOG_FILE_PREFIX + localNode.id(),
ClusterMessagingProtocol.DB_SERIALIZER);
- copycat = new Copycat(stateMachine, consensusLog, cluster, copycatMessagingProtocol);
+ CopycatConfig ccConfig = new CopycatConfig();
+ ccConfig.setMaxLogSize(maxLogSizeBytes);
+
+ copycat = new Copycat(stateMachine, consensusLog, cluster, copycatMessagingProtocol, ccConfig);
copycat.event(LeaderElectEvent.class).registerHandler(new RaftLeaderElectionMonitor());
copycat.event(LeaderElectEvent.class).registerHandler(expirationTracker);
}