public interface LogStorage extends Lifecycle<LogStorageOptions>, Storage
| 限定符和类型 | 方法和说明 |
|---|---|
int |
appendEntries(List<LogEntry> entries)
Append entries to log, return append success number.
|
boolean |
appendEntry(LogEntry entry)
Append entries to log.
|
LogEntry |
getEntry(long index)
Get logEntry by index.
|
long |
getFirstLogIndex()
Returns first log index in log.
|
long |
getLastLogIndex()
Returns last log index in log.
|
long |
getTerm(long index)
已过时。
|
boolean |
reset(long nextLogIndex)
Drop all the existing logs and reset next log index to |next_log_index|.
|
boolean |
truncatePrefix(long firstIndexKept)
Delete logs from storage's head, [first_log_index, first_index_kept) will
be discarded.
|
boolean |
truncateSuffix(long lastIndexKept)
Delete uncommitted logs from storage's tail, (last_index_kept, last_log_index]
will be discarded.
|
long getFirstLogIndex()
long getLastLogIndex()
LogEntry getEntry(long index)
@Deprecated long getTerm(long index)
getEntry(long) to get the log id's term.boolean appendEntry(LogEntry entry)
int appendEntries(List<LogEntry> entries)
boolean truncatePrefix(long firstIndexKept)
boolean truncateSuffix(long lastIndexKept)
boolean reset(long nextLogIndex)
Copyright © 2021. All rights reserved.