public class SimpleStateMachineStorage extends Object implements StateMachineStorage
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
SNAPSHOT_MD5_REGEX |
static Pattern |
SNAPSHOT_REGEX
snapshot.term_index
|
| Constructor and Description |
|---|
SimpleStateMachineStorage() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanupOldSnapshots(SnapshotRetentionPolicy snapshotRetentionPolicy) |
void |
format() |
protected File |
getCorruptSnapshotFile(long term,
long endIndex) |
protected static String |
getCorruptSnapshotFileName(long term,
long endIndex) |
SingleFileSnapshotInfo |
getLatestSnapshot() |
File |
getSnapshotFile(long term,
long endIndex) |
static String |
getSnapshotFileName(long term,
long endIndex) |
static TermIndex |
getTermIndexFromSnapshotFile(File file) |
protected File |
getTmpSnapshotFile(long term,
long endIndex) |
protected static String |
getTmpSnapshotFileName(long term,
long endIndex) |
void |
init(RaftStorage storage) |
SingleFileSnapshotInfo |
updateLatestSnapshot(SingleFileSnapshotInfo info) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSnapshotDir, getTmpDirpublic static final Pattern SNAPSHOT_REGEX
public static final Pattern SNAPSHOT_MD5_REGEX
public void init(RaftStorage storage) throws IOException
init in interface StateMachineStorageIOExceptionpublic void format()
throws IOException
format in interface StateMachineStorageIOExceptionpublic void cleanupOldSnapshots(SnapshotRetentionPolicy snapshotRetentionPolicy) throws IOException
cleanupOldSnapshots in interface StateMachineStorageIOExceptionprotected static String getTmpSnapshotFileName(long term, long endIndex)
protected static String getCorruptSnapshotFileName(long term, long endIndex)
public File getSnapshotFile(long term, long endIndex)
protected File getTmpSnapshotFile(long term, long endIndex)
protected File getCorruptSnapshotFile(long term, long endIndex)
public SingleFileSnapshotInfo updateLatestSnapshot(SingleFileSnapshotInfo info)
public static String getSnapshotFileName(long term, long endIndex)
public SingleFileSnapshotInfo getLatestSnapshot()
getLatestSnapshot in interface StateMachineStorageCopyright © 2017–2023 The Apache Software Foundation. All rights reserved.