Skip to content

Commit

Permalink
update the javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
SzyWilliam committed Mar 26, 2024
1 parent eeacd38 commit f4ca209
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,24 @@
*/
public interface SnapshotManagementApi {

/** trigger create snapshot file. */
/** The same as create(0, timeoutMs). */
default RaftClientReply create(long timeoutMs) throws IOException {
return create(0, timeoutMs);
}

/** trigger create snapshot file. If forced, ignore the creation gap. */
/** The same as create(force? 1 : 0, timeoutMs). */
default RaftClientReply create(boolean force, long timeoutMs) throws IOException {
return create(1, timeoutMs);
return create(force? 1 : 0, timeoutMs);
}

/** trigger create snapshot file if the number of newly applied logs since last snapshot exceeds creationGap. */
/**
* Trigger to create a snapshot.
*
* @param creationGap When (creationGap > 0) and (astAppliedIndex - lastSnapshotIndex < creationGap),
* return lastSnapshotIndex; otherwise, take a new snapshot and then return its index.
* When creationGap == 0, use the server configured value as the creationGap.
* @return a reply. When {@link RaftClientReply#isSuccess()} is true,
* {@link RaftClientReply#getLogIndex()} is the snapshot index fulfilling the operation.
*/
RaftClientReply create(long creationGap, long timeoutMs) throws IOException;
}

0 comments on commit f4ca209

Please sign in to comment.