Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix remaining CS errors in sal-akka-raft and enable enforcement
[controller.git]
/
opendaylight
/
md-sal
/
sal-akka-raft
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
raft
/
SnapshotState.java
diff --git
a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotState.java
b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotState.java
index 9949211c63c416d69fb6a97ba6d6ae6bc823c086..e423737706bc0d42055d388bb72b7f4a7890256b 100644
(file)
--- a/
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotState.java
+++ b/
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotState.java
@@
-8,62
+8,74
@@
package org.opendaylight.controller.cluster.raft;
package org.opendaylight.controller.cluster.raft;
-import org.opendaylight.controller.cluster.raft.b
ehaviors.RaftActorBehavior
;
+import org.opendaylight.controller.cluster.raft.b
ase.messages.ApplySnapshot
;
+/**
+ * Interface for a snapshot phase state.
+ *
+ * @author Moiz Raja
+ * @author Thomas Pantelis
+ */
public interface SnapshotState {
/**
public interface SnapshotState {
/**
- * Should return true when a snapshot is being captured
- * @return
+ * Returns whether or not a capture is in progress.
+ *
+ * @return true when a snapshot is being captured, false otherwise
*/
boolean isCapturing();
/**
*/
boolean isCapturing();
/**
- * Initiate
capture snapshot
+ * Initiate
s a capture snapshot.
*
* @param lastLogEntry the last entry in the replicated log
* @param replicatedToAllIndex the current replicatedToAllIndex
*
* @param lastLogEntry the last entry in the replicated log
* @param replicatedToAllIndex the current replicatedToAllIndex
- *
* @return true if capture was started
*/
boolean capture(ReplicatedLogEntry lastLogEntry, long replicatedToAllIndex);
/**
* @return true if capture was started
*/
boolean capture(ReplicatedLogEntry lastLogEntry, long replicatedToAllIndex);
/**
- * Initiate capture snapshot for the purposing of installing that snapshot
- *
- * @param lastLogEntry
- * @param replicatedToAllIndex
- * @param targetFollower
+ * Initiates a capture snapshot for the purposing of installing the snapshot on a follower.
*
*
+ * @param lastLogEntry the last entry in the replicated log
+ * @param replicatedToAllIndex the current replicatedToAllIndex
+ * @param targetFollower the id of the follower on which to install
* @return true if capture was started
*/
boolean captureToInstall(ReplicatedLogEntry lastLogEntry, long replicatedToAllIndex, String targetFollower);
/**
* @return true if capture was started
*/
boolean captureToInstall(ReplicatedLogEntry lastLogEntry, long replicatedToAllIndex, String targetFollower);
/**
- * Persist the snapshot
+ * Applies a snapshot on a follower that was installed by the leader.
+ *
+ * @param snapshot the Snapshot to apply.
+ */
+ void apply(ApplySnapshot snapshot);
+
+ /**
+ * Persists a snapshot.
*
*
- * @param snapshotBytes
- * @param currentBehavior
- * @param totalMemory
+ * @param snapshotBytes the snapshot bytes
+ * @param totalMemory the total memory threshold
*/
*/
- void persist(byte[] snapshotBytes,
RaftActorBehavior currentBehavior,
long totalMemory);
+ void persist(byte[] snapshotBytes, long totalMemory);
/**
/**
- * Commit the snapshot by trimming the log
+ * Commit the snapshot by trimming the log
.
*
*
- * @param sequenceNumber
+ * @param sequenceNumber the sequence number of the persisted snapshot
+ * @param timeStamp the time stamp of the persisted snapshot
*/
*/
- void commit(long sequenceNumber);
+ void commit(long sequenceNumber
, long timeStamp
);
/**
/**
- * Roll
back the snapshot
+ * Roll
s back the snapshot on failure.
*/
void rollback();
/**
*/
void rollback();
/**
- * Trim
the log
+ * Trim
s the in-memory log.
*
*
- * @param desiredTrimIndex
+ * @param desiredTrimIndex
the desired index to trim from
* @return the actual trim index
*/
* @return the actual trim index
*/
- long trimLog(long desiredTrimIndex
, RaftActorBehavior currentBehavior
);
+ long trimLog(long desiredTrimIndex);
}
}