*/
package org.opendaylight.controller.cluster.raft;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.List;
+import org.opendaylight.controller.cluster.raft.persisted.ServerConfigurationPayload;
-
+/**
+ * Represents a snapshot of the raft data.
+ *
+ * @author Moiz Raja
+ * @author Thomas Pantelis
+ */
public class Snapshot implements Serializable {
private static final long serialVersionUID = -8298574936724056236L;
electionTerm, electionVotedFor, serverConfig);
}
+ @SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "Exposes a mutable object stored in a field but "
+ + "this is OK since this class is merely a DTO and does not process the byte[] internally. "
+ + "Also it would be inefficient to create a return copy as the byte[] could be large.")
public byte[] getState() {
return state;
}
public String toString() {
return "Snapshot [lastIndex=" + lastIndex + ", lastTerm=" + lastTerm + ", lastAppliedIndex=" + lastAppliedIndex
+ ", lastAppliedTerm=" + lastAppliedTerm + ", unAppliedEntries size=" + unAppliedEntries.size()
- + ", state size=" + state.length + ", electionTerm=" + electionTerm + ", electionVotedFor=" + electionVotedFor
- + ", ServerConfigPayload=" + serverConfig + "]";
+ + ", state size=" + state.length + ", electionTerm=" + electionTerm + ", electionVotedFor="
+ + electionVotedFor + ", ServerConfigPayload=" + serverConfig + "]";
}
}