public class BDBLogStorage extends Object implements LogStorage, Describer
Describer.DefaultPrinter, Describer.Printer| Modifier and Type | Field and Description |
|---|---|
static byte[] |
FIRST_LOG_IDX_KEY
First log index and last log index key in configuration column family.
|
| Constructor and Description |
|---|
BDBLogStorage(String homePath,
RaftOptions raftOptions) |
| Modifier and Type | Method and Description |
|---|---|
int |
appendEntries(List<LogEntry> entries) |
boolean |
appendEntry(LogEntry entry) |
void |
describe(Describer.Printer out) |
LogEntry |
getEntry(long index) |
long |
getFirstLogIndex() |
protected byte[] |
getKeyBytes(long index) |
protected com.sleepycat.je.DatabaseEntry |
getKeyDatabaseEntry(long index) |
long |
getLastLogIndex() |
long |
getTerm(long index) |
boolean |
init(LogStorageOptions opts) |
protected boolean |
isSuccessOperation(com.sleepycat.je.OperationStatus status) |
boolean |
reset(long nextLogIndex) |
void |
shutdown() |
protected com.sleepycat.je.DatabaseEntry |
toDatabaseEntry(LogEntry logEntry) |
protected LogEntry |
toLogEntry(com.sleepycat.je.DatabaseEntry logEntry) |
boolean |
truncatePrefix(long firstIndexKept) |
boolean |
truncateSuffix(long lastIndexKept) |
public static final byte[] FIRST_LOG_IDX_KEY
public BDBLogStorage(String homePath, RaftOptions raftOptions)
public boolean init(LogStorageOptions opts)
init in interface Lifecycle<LogStorageOptions>public void shutdown()
shutdown in interface Lifecycle<LogStorageOptions>public void describe(Describer.Printer out)
public long getFirstLogIndex()
getFirstLogIndex in interface LogStoragepublic long getLastLogIndex()
getLastLogIndex in interface LogStoragepublic LogEntry getEntry(long index)
getEntry in interface LogStoragepublic long getTerm(long index)
getTerm in interface LogStoragepublic boolean appendEntry(LogEntry entry)
appendEntry in interface LogStoragepublic int appendEntries(List<LogEntry> entries)
appendEntries in interface LogStoragepublic boolean truncatePrefix(long firstIndexKept)
truncatePrefix in interface LogStoragepublic boolean truncateSuffix(long lastIndexKept)
truncateSuffix in interface LogStoragepublic boolean reset(long nextLogIndex)
reset in interface LogStorageprotected byte[] getKeyBytes(long index)
protected com.sleepycat.je.DatabaseEntry getKeyDatabaseEntry(long index)
protected boolean isSuccessOperation(com.sleepycat.je.OperationStatus status)
protected LogEntry toLogEntry(com.sleepycat.je.DatabaseEntry logEntry)
protected com.sleepycat.je.DatabaseEntry toDatabaseEntry(LogEntry logEntry)
Copyright © 2022. All rights reserved.