public class SimpleStateMachineStorage extends Object implements StateMachineStorage
| 限定符和类型 | 字段和说明 |
|---|---|
static Pattern |
SNAPSHOT_MD5_REGEX |
static Pattern |
SNAPSHOT_REGEX
snapshot.term_index
|
| 构造器和说明 |
|---|
SimpleStateMachineStorage() |
| 限定符和类型 | 方法和说明 |
|---|---|
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 |
loadLatestSnapshot() |
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 在接口中 StateMachineStorageIOExceptionpublic void format()
throws IOException
format 在接口中 StateMachineStorageIOExceptionpublic void cleanupOldSnapshots(SnapshotRetentionPolicy snapshotRetentionPolicy) throws IOException
cleanupOldSnapshots 在接口中 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 在接口中 StateMachineStoragepublic SingleFileSnapshotInfo loadLatestSnapshot()
Copyright © 2017–2025 The Apache Software Foundation. All rights reserved.