java.lang.AutoCloseable, java.io.Closeable, Storage.FormatConfirmableFileJournalManager, JournalSet, QuorumJournalManager@Private @Evolving public interface JournalManager extends java.io.Closeable, Storage.FormatConfirmable
| Modifier and Type | Interface | Description |
|---|---|---|
static class |
JournalManager.CorruptionException |
Indicate that a journal is cannot be used to load a certain range of
edits.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
canRollBack(StorageInfo storage,
StorageInfo prevStorage,
int targetLayoutVersion) |
Return true if this JM can roll back to the previous storage state, false
otherwise.
|
void |
close() |
Close the journal manager, freeing any resources it may hold.
|
void |
discardSegments(long startTxId) |
Discard the segments whose first txid is >= the given txid.
|
void |
doFinalize() |
Finalize the upgrade.
|
void |
doPreUpgrade() |
Perform any steps that must succeed across all JournalManagers involved in
an upgrade before proceeding onto the actual upgrade stage.
|
void |
doRollback() |
Perform the rollback to the previous FS state.
|
void |
doUpgrade(Storage storage) |
Perform the actual upgrade of the JM.
|
void |
finalizeLogSegment(long firstTxId,
long lastTxId) |
Mark the log segment that spans from firstTxId to lastTxId
as finalized and complete.
|
void |
format(NamespaceInfo ns,
boolean force) |
Format the underlying storage, removing any previously
stored data.
|
long |
getJournalCTime() |
|
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(java.util.Collection<EditLogInputStream> streams,
long fromTxId,
boolean inProgressOk,
boolean onlyDurableTxns) |
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,
int layoutVersion) |
Begin writing to a new segment of the log stream, which starts at
the given transaction ID.
|
hasSomeData, toStringvoid format(NamespaceInfo ns, boolean force) throws java.io.IOException
java.io.IOExceptionEditLogOutputStream startLogSegment(long txId, int layoutVersion) throws java.io.IOException
java.io.IOExceptionvoid finalizeLogSegment(long firstTxId,
long lastTxId)
throws java.io.IOException
java.io.IOExceptionvoid setOutputBufferCapacity(int size)
void recoverUnfinalizedSegments()
throws java.io.IOException
java.io.IOExceptionvoid doPreUpgrade()
throws java.io.IOException
java.io.IOExceptionvoid doUpgrade(Storage storage) throws java.io.IOException
storage - info about the new upgraded versions.java.io.IOExceptionvoid doFinalize()
throws java.io.IOException
java.io.IOExceptionboolean canRollBack(StorageInfo storage, StorageInfo prevStorage, int targetLayoutVersion) throws java.io.IOException
storage - the storage info for the current stateprevStorage - the storage info for the previous (unupgraded) statetargetLayoutVersion - the layout version we intend to roll back tojava.io.IOExceptionvoid doRollback()
throws java.io.IOException
java.io.IOExceptionvoid discardSegments(long startTxId)
throws java.io.IOException
startTxId - The given txid should be right at the segment boundary,
i.e., it should be the first txid of some segment, if segment corresponding
to the txid exists.java.io.IOExceptionlong getJournalCTime()
throws java.io.IOException
java.io.IOExceptionvoid close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionvoid purgeLogsOlderThan(long minTxIdToKeep)
throws java.io.IOException
minTxIdToKeep - the lowest transaction ID that should be retainedjava.io.IOException - in the event of errorvoid selectInputStreams(java.util.Collection<EditLogInputStream> streams, long fromTxId, boolean inProgressOk, boolean onlyDurableTxns) throws java.io.IOException
fromTxId - the first transaction id we want to readinProgressOk - whether or not in-progress streams should be returnedonlyDurableTxns - whether or not streams should be bounded by durable
TxId. A durable TxId is the committed txid in QJM
or the largest txid written into file in FJMjava.io.IOException - if the underlying storage has an error or is otherwise
inaccessibleCopyright © 2008–2025 Apache Software Foundation. All rights reserved.