public class SnapshottableLogManager extends Object implements LogManager
| Constructor and Description |
|---|
SnapshottableLogManager(LogManager logManager,
LogManager snapshotManager) |
| Modifier and Type | Method and Description |
|---|---|
long |
appendEntry(ByteBuffer entry) |
long |
appendSnapshot(long index,
List<ByteBuffer> snapshot)
Appends a snapshot to the log.
|
void |
close() |
void |
compact(long index) |
LogConfig |
config() |
boolean |
containsIndex(long index) |
void |
delete() |
long |
entryCount() |
Long |
firstIndex() |
LogSegment |
firstSegment() |
void |
flush() |
ByteBuffer |
getEntry(long index) |
long |
index() |
boolean |
isClosed() |
boolean |
isEmpty() |
boolean |
isOpen() |
boolean |
isSnapshottable(long index)
Returns a boolean value indicating whether the given index is a snapshottable index.
|
Long |
lastIndex() |
LogSegment |
lastSegment() |
void |
open() |
void |
removeAfter(long index) |
void |
rollOver(long index) |
LogSegment |
segment() |
LogSegment |
segment(long index) |
TreeMap<Long,LogSegment> |
segments() |
long |
size() |
public SnapshottableLogManager(LogManager logManager, LogManager snapshotManager)
public LogConfig config()
config in interface LogManagerpublic TreeMap<Long,LogSegment> segments()
segments in interface LogManagerpublic LogSegment segment()
segment in interface LogManagerpublic LogSegment segment(long index)
segment in interface LogManagerpublic LogSegment firstSegment()
firstSegment in interface LogManagerpublic LogSegment lastSegment()
lastSegment in interface LogManagerpublic void open()
throws IOException
open in interface LoggableIOExceptionpublic long entryCount()
entryCount in interface Loggablepublic boolean isSnapshottable(long index)
index - The index to check.public long appendSnapshot(long index,
List<ByteBuffer> snapshot)
throws IOException
index - The index at which to write the snapshot.snapshot - The snapshot to append to the snapshot log.IOException - If the log could not be rolled over.public long appendEntry(ByteBuffer entry) throws IOException
appendEntry in interface LoggableIOExceptionpublic Long firstIndex()
firstIndex in interface Loggablepublic boolean containsIndex(long index)
containsIndex in interface Loggablepublic ByteBuffer getEntry(long index)
public void removeAfter(long index)
removeAfter in interface Loggablepublic void rollOver(long index)
throws IOException
rollOver in interface LogManagerIOExceptionpublic void compact(long index)
throws IOException
compact in interface LogManagerIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface LoggableIOExceptionCopyright © 2013-2015. All Rights Reserved.