X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FReplicatedLog.java;h=71576f6d21b71fd02704e50d74e431f16a641f50;hp=6e34ff0393e8840ea70e0b7d398cc155c257d294;hb=1b0f84c4957e464bad6f7cb7350a8171c3d1621b;hpb=fa96da71c5ab10973a9f93c2e8b35494b96fd7ed diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLog.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLog.java index 6e34ff0393..71576f6d21 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLog.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLog.java @@ -205,9 +205,17 @@ public interface ReplicatedLog { int dataSize(); /** - * Determines if a snapshot need to be captured based on the count/memory consumed. + * Determines if a snapshot needs to be captured based on the count/memory consumed and initiates the capture. * * @param replicatedLogEntry the last log entry. */ void captureSnapshotIfReady(ReplicatedLogEntry replicatedLogEntry); + + /** + * Determines if a snapshot should be captured based on the count/memory consumed. + * + * @param logIndex the log index to use to determine if the log count has exceeded the threshold + * @return true if a snapshot should be captured, false otherwise + */ + boolean shouldCaptureSnapshot(long logIndex); }