Class Journal
java.lang.Object
org.apache.hadoop.hdfs.qjournal.server.Journal
- All Implemented Interfaces:
Closeable,AutoCloseable
A JournalNode can manage journals for several clusters at once.
Each such journal is entirely independent despite being hosted by
the same JVM.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptRecovery(RequestInfo reqInfo, QJournalProtocolProtos.SegmentStateProto segment, URL fromUrl) canRollBack(StorageInfo storage, StorageInfo prevStorage, int targetLayoutVersion) voidclose()Unlock and release resources.voidvoidvoidvoiddoUpgrade(StorageInfo sInfo) voidfinalizeLogSegment(RequestInfo reqInfo, long startTxId, long endTxId) Finalize the log segment at the given transaction ID.getEditLogManifest(long sinceTxId, boolean inProgressOk) getJournaledEdits(long sinceTxId, int maxTxns) longbooleanvoidheartbeat(RequestInfo reqInfo) booleanprepareRecovery(RequestInfo reqInfo, long segmentTxId) voidpurgeLogsOlderThan(RequestInfo reqInfo, long minTxIdToKeep) voidsetTriedJournalSyncerStartedwithnsId(boolean started) voidstartLogSegment(RequestInfo reqInfo, long txid, int layoutVersion) Start a new segment at the given txid.
-
Field Details
-
LAST_PROMISED_FILENAME
- See Also:
-
LAST_WRITER_EPOCH
- See Also:
-
-
Method Details
-
setTriedJournalSyncerStartedwithnsId
public void setTriedJournalSyncerStartedwithnsId(boolean started) -
getTriedJournalSyncerStartedwithnsId
public boolean getTriedJournalSyncerStartedwithnsId() -
close
Unlock and release resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getLastWriterEpoch
- Throws:
IOException
-
heartbeat
- Throws:
IOException
-
isFormatted
public boolean isFormatted() -
startLogSegment
Start a new segment at the given txid. The previous segment must have already been finalized.- Throws:
IOException
-
finalizeLogSegment
public void finalizeLogSegment(RequestInfo reqInfo, long startTxId, long endTxId) throws IOException Finalize the log segment at the given transaction ID.- Throws:
IOException
-
purgeLogsOlderThan
- Throws:
IOException- See Also:
-
LogsPurgeable.purgeLogsOlderThan(long)
-
getEditLogManifest
public RemoteEditLogManifest getEditLogManifest(long sinceTxId, boolean inProgressOk) throws IOException -
getJournaledEdits
public QJournalProtocolProtos.GetJournaledEditsResponseProto getJournaledEdits(long sinceTxId, int maxTxns) throws IOException - Throws:
IOException- See Also:
-
prepareRecovery
public QJournalProtocolProtos.PrepareRecoveryResponseProto prepareRecovery(RequestInfo reqInfo, long segmentTxId) throws IOException - Throws:
IOException- See Also:
-
acceptRecovery
public void acceptRecovery(RequestInfo reqInfo, QJournalProtocolProtos.SegmentStateProto segment, URL fromUrl) throws IOException -
doPreUpgrade
- Throws:
IOException
-
doUpgrade
- Throws:
IOException
-
doFinalize
- Throws:
IOException
-
canRollBack
public Boolean canRollBack(StorageInfo storage, StorageInfo prevStorage, int targetLayoutVersion) throws IOException - Throws:
IOException
-
doRollback
- Throws:
IOException
-
getJournalCTime
- Throws:
IOException
-