@InterfaceAudience.Private @InterfaceStability.Evolving public interface JournalManager extends Closeable, Storage.FormatConfirmable
Modifier and Type | Interface and Description |
---|---|
static class |
JournalManager.CorruptionException
Indicate that a journal is cannot be used to load a certain range of
edits.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the journal manager, freeing any resources it may hold.
|
void |
finalizeLogSegment(long firstTxId,
long lastTxId)
Mark the log segment that spans from firstTxId to lastTxId
as finalized and complete.
|
void |
format(NamespaceInfo ns)
Format the underlying storage, removing any previously
stored data.
|
void |
purgeLogsOlderThan(long minTxIdToKeep)
Remove all edit logs with transaction IDs lower than the given transaction
ID.
|
void |
recoverUnfinalizedSegments()
Recover segments which have not been finalized.
|
void |
selectInputStreams(Collection<EditLogInputStream> streams,
long fromTxId,
boolean inProgressOk,
boolean forReading)
Get a list of edit log input streams.
|
void |
setOutputBufferCapacity(int size)
Set the amount of memory that this stream should use to buffer edits
|
EditLogOutputStream |
startLogSegment(long txId)
Begin writing to a new segment of the log stream, which starts at
the given transaction ID.
|
hasSomeData, toString
void format(NamespaceInfo ns) throws IOException
IOException
EditLogOutputStream startLogSegment(long txId) throws IOException
IOException
void finalizeLogSegment(long firstTxId, long lastTxId) throws IOException
IOException
void setOutputBufferCapacity(int size)
void recoverUnfinalizedSegments() throws IOException
IOException
void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
void purgeLogsOlderThan(long minTxIdToKeep) throws IOException
minTxIdToKeep
- the lowest transaction ID that should be retainedIOException
- in the event of errorvoid selectInputStreams(Collection<EditLogInputStream> streams, long fromTxId, boolean inProgressOk, boolean forReading) throws IOException
fromTxId
- the first transaction id we want to readinProgressOk
- whether or not in-progress streams should be returnedforReading
- whether or not the caller intends to read from the edit logsIOException
- if the underlying storage has an error or is otherwise
inaccessibleCopyright © 2013 Apache Software Foundation. All rights reserved.