X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FSnapshotManager.java;h=79f2ce9b4ca0fb2b0deca496eed67e069bc1a547;hb=79e6240ad565717e2fba62a339f11fcbd239f440;hp=5db4706c623e3a8219554bcb40f08e584e2bda71;hpb=c9943f5bc72d4cde9356d3bd4cf73d36f4b2f754;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotManager.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotManager.java index 5db4706c62..79f2ce9b4c 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotManager.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotManager.java @@ -27,8 +27,13 @@ import org.slf4j.Logger; */ public class SnapshotManager implements SnapshotState { + @SuppressWarnings("checkstyle:MemberName") private final SnapshotState IDLE = new Idle(); + + @SuppressWarnings({"checkstyle:MemberName", "checkstyle:AbbreviationAsWordInName"}) private final SnapshotState PERSISTING = new Persisting(); + + @SuppressWarnings({"checkstyle:MemberName", "checkstyle:AbbreviationAsWordInName"}) private final SnapshotState CREATING = new Creating(); private final Logger log; @@ -159,8 +164,8 @@ public class SnapshotManager implements SnapshotState { lastLogEntryIndex = lastLogEntry.getIndex(); lastLogEntryTerm = lastLogEntry.getTerm(); } else { - log.debug("{}: Capturing Snapshot : lastLogEntry is null. Using lastAppliedIndex {} and lastAppliedTerm {} instead.", - persistenceId(), lastAppliedIndex, lastAppliedTerm); + log.debug("{}: Capturing Snapshot : lastLogEntry is null. Using lastAppliedIndex {} and " + + "lastAppliedTerm {} instead.", persistenceId(), lastAppliedIndex, lastAppliedTerm); } return new CaptureSnapshot(lastLogEntryIndex, lastLogEntryTerm, lastAppliedIndex, lastAppliedTerm, @@ -254,6 +259,7 @@ public class SnapshotManager implements SnapshotState { return false; } + @SuppressWarnings("checkstyle:IllegalCatch") private boolean capture(ReplicatedLogEntry lastLogEntry, long replicatedToAllIndex, String targetFollower) { captureSnapshot = newCaptureSnapshot(lastLogEntry, replicatedToAllIndex, targetFollower != null); @@ -344,12 +350,12 @@ public class SnapshotManager implements SnapshotState { if (dataSizeThresholdExceeded || logSizeExceededSnapshotBatchCount) { if (log.isDebugEnabled()) { if (dataSizeThresholdExceeded) { - log.debug("{}: log data size {} exceeds the memory threshold {} - doing snapshotPreCommit with index {}", - context.getId(), context.getReplicatedLog().dataSize(), dataThreshold, - captureSnapshot.getLastAppliedIndex()); + log.debug("{}: log data size {} exceeds the memory threshold {} - doing snapshotPreCommit " + + "with index {}", context.getId(), context.getReplicatedLog().dataSize(), + dataThreshold, captureSnapshot.getLastAppliedIndex()); } else { - log.debug("{}: log size {} exceeds the snapshot batch count {} - doing snapshotPreCommit with index {}", - context.getId(), context.getReplicatedLog().size(), + log.debug("{}: log size {} exceeds the snapshot batch count {} - doing snapshotPreCommit with " + + "index {}", context.getId(), context.getReplicatedLog().size(), context.getConfigParams().getSnapshotBatchCount(), captureSnapshot.getLastAppliedIndex()); } @@ -407,6 +413,7 @@ public class SnapshotManager implements SnapshotState { private class Persisting extends AbstractSnapshotState { @Override + @SuppressWarnings("checkstyle:IllegalCatch") public void commit(final long sequenceNumber, long timeStamp) { log.debug("{}: Snapshot success - sequence number: {}", persistenceId(), sequenceNumber);