public class RocksDBSegmentLogStorage extends RocksDBLogStorage
| 限定符和类型 | 类和说明 |
|---|---|
static class |
RocksDBSegmentLogStorage.BarrierWriteContext |
static class |
RocksDBSegmentLogStorage.Builder
RocksDBSegmentLogStorage builder
|
RocksDBLogStorage.EmptyWriteContext, RocksDBLogStorage.WriteContextDescriber.DefaultPrinter, Describer.PrinterFIRST_LOG_IDX_KEY| 构造器和说明 |
|---|
RocksDBSegmentLogStorage(String path,
RaftOptions raftOptions) |
RocksDBSegmentLogStorage(String path,
RaftOptions raftOptions,
int valueSizeThreshold,
int maxSegmentFileSize) |
RocksDBSegmentLogStorage(String path,
RaftOptions raftOptions,
int valueSizeThreshold,
int maxSegmentFileSize,
int preAllocateSegmentCount,
int keepInMemorySegmentCount,
int checkpointIntervalMs,
ThreadPoolExecutor writeExecutor) |
| 限定符和类型 | 方法和说明 |
|---|---|
static RocksDBSegmentLogStorage.Builder |
builder(String uri,
RaftOptions raftOptions)
Creates a RocksDBSegmentLogStorage builder.
|
SegmentFile |
getLastSegmentFileForRead() |
protected RocksDBLogStorage.WriteContext |
newWriteContext() |
protected byte[] |
onDataAppend(long logIndex,
byte[] value,
RocksDBLogStorage.WriteContext ctx)
Called before appending data entry.
|
protected byte[] |
onDataGet(long logIndex,
byte[] value)
Called after getting data from rocksdb.
|
protected boolean |
onInitLoaded()
Called after opening RocksDB and loading configuration into conf manager.
|
protected void |
onReset(long nextLogIndex)
Called after resetting db.
|
protected void |
onShutdown()
Called after closing db.
|
protected void |
onSync()
Called when sync data into file system.
|
protected void |
onTruncatePrefix(long startIndex,
long firstIndexKept)
Called after truncating prefix logs in rocksdb.
|
protected void |
onTruncateSuffix(long lastIndexKept)
Called after truncating suffix logs in rocksdb.
|
appendEntries, appendEntry, createColumnFamilyOptions, createDBOptions, describe, getEntry, getFirstLogIndex, getKeyBytes, getLastLogIndex, getTerm, getValueFromRocksDB, init, isSync, reset, shutdown, truncatePrefix, truncateSuffixpublic RocksDBSegmentLogStorage(String path, RaftOptions raftOptions)
public RocksDBSegmentLogStorage(String path, RaftOptions raftOptions, int valueSizeThreshold, int maxSegmentFileSize)
public RocksDBSegmentLogStorage(String path, RaftOptions raftOptions, int valueSizeThreshold, int maxSegmentFileSize, int preAllocateSegmentCount, int keepInMemorySegmentCount, int checkpointIntervalMs, ThreadPoolExecutor writeExecutor)
public static final RocksDBSegmentLogStorage.Builder builder(String uri, RaftOptions raftOptions)
protected void onSync()
throws IOException,
InterruptedException
RocksDBLogStorageonSync 在类中 RocksDBLogStorageIOExceptionInterruptedExceptionprotected boolean onInitLoaded()
RocksDBLogStorageonInitLoaded 在类中 RocksDBLogStorageprotected void onShutdown()
RocksDBLogStorageonShutdown 在类中 RocksDBLogStoragepublic SegmentFile getLastSegmentFileForRead() throws IOException, InterruptedException
protected void onReset(long nextLogIndex)
RocksDBLogStorageonReset 在类中 RocksDBLogStoragenextLogIndex - next log indexprotected void onTruncatePrefix(long startIndex,
long firstIndexKept)
throws org.rocksdb.RocksDBException,
IOException
RocksDBLogStorageonTruncatePrefix 在类中 RocksDBLogStoragestartIndex - the start indexfirstIndexKept - the first index to keptorg.rocksdb.RocksDBExceptionIOExceptionprotected void onTruncateSuffix(long lastIndexKept)
throws org.rocksdb.RocksDBException,
IOException
RocksDBLogStorageonTruncateSuffix 在类中 RocksDBLogStoragelastIndexKept - the last index to keptorg.rocksdb.RocksDBExceptionIOExceptionprotected RocksDBLogStorage.WriteContext newWriteContext()
newWriteContext 在类中 RocksDBLogStorageprotected byte[] onDataAppend(long logIndex,
byte[] value,
RocksDBLogStorage.WriteContext ctx)
throws IOException,
InterruptedException
RocksDBLogStorageonDataAppend 在类中 RocksDBLogStoragelogIndex - the log indexvalue - the data value in log entry.IOExceptionInterruptedExceptionprotected byte[] onDataGet(long logIndex,
byte[] value)
throws IOException
RocksDBLogStorageonDataGet 在类中 RocksDBLogStoragelogIndex - the log indexvalue - the value in rocksdbIOExceptionCopyright © 2021. All rights reserved.