public class SimpleStateMachineStorage extends Object implements StateMachineStorage
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
SNAPSHOT_REGEX
snapshot.term_index
|
| Constructor and Description |
|---|
SimpleStateMachineStorage() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanupOldSnapshots(SnapshotRetentionPolicy snapshotRetentionPolicy) |
SingleFileSnapshotInfo |
findLatestSnapshot() |
void |
format() |
protected File |
getCorruptSnapshotFile(long term,
long endIndex) |
protected static String |
getCorruptSnapshotFileName(long term,
long endIndex) |
SingleFileSnapshotInfo |
getLatestSnapshot() |
File |
getSmDir() |
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 rStorage) |
void |
loadLatestSnapshot() |
public static final Pattern SNAPSHOT_REGEX
public void init(RaftStorage rStorage) 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 findLatestSnapshot() throws IOException
IOExceptionpublic void loadLatestSnapshot()
throws IOException
IOExceptionpublic static String getSnapshotFileName(long term, long endIndex)
public SingleFileSnapshotInfo getLatestSnapshot()
getLatestSnapshot in interface StateMachineStoragepublic File getSmDir()
Copyright © 2017–2021 The Apache Software Foundation. All rights reserved.