@Private
@Evolving
public class FSEditLog
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
protected FSEditLogOp.OpInstanceCache |
cache |
|
static org.slf4j.Logger |
LOG |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
beginTransaction(FSEditLogOp op) |
|
boolean |
canRollBackSharedLog(StorageInfo prevStorage,
int targetLayoutVersion) |
|
void |
discardSegments(long markerTxid) |
|
void |
doFinalizeOfSharedLog() |
|
void |
doPreUpgradeOfSharedLog() |
|
void |
doRollback() |
|
void |
doUpgradeOfSharedLog() |
|
void |
endCurrentLogSegment(boolean writeEndTxn) |
Finalize the current log segment.
|
long |
getCurSegmentTxId() |
|
RemoteEditLogManifest |
getEditLogManifest(long fromTxId) |
Return a manifest of what finalized edit logs are available
|
JournalSet |
getJournalSet() |
Used only by tests.
|
long |
getLastWrittenTxId() |
Return the transaction ID of the last transaction written to the log.
|
long |
getSharedLogCTime() |
|
long |
getSyncTxId() |
Return the txid of the last synced transaction.
|
long |
getTotalSyncCount() |
Return total number of syncs happened on this edit log.
|
void |
initJournalsForWrite() |
|
void |
initSharedJournalsForRead() |
|
boolean |
isOpenForRead() |
|
void |
journal(long firstTxId,
int numTxns,
byte[] data) |
Write the batch of edits to edit log.
|
void |
logAddBlock(java.lang.String path,
INodeFile file) |
|
void |
logAppendFile(java.lang.String path,
INodeFile file,
boolean newBlock,
boolean toLogRpcIds) |
|
void |
logCloseFile(java.lang.String path,
INodeFile newNode) |
Add close lease record to edit log.
|
void |
logMkDir(java.lang.String path,
INode newNode) |
Add create directory record to edit log
|
void |
logOpenFile(java.lang.String path,
INodeFile newNode,
boolean overwrite,
boolean toLogRpcIds) |
Add open lease record to edit log.
|
void |
logSync() |
Sync all modifications done by this thread.
|
protected void |
logSync(long mytxid) |
|
void |
logUpdateBlocks(java.lang.String path,
INodeFile file,
boolean toLogRpcIds) |
|
void |
purgeLogsOlderThan(long minTxIdToKeep) |
Archive any log files that are older than the given txid.
|
void |
restart() |
|
java.util.Collection<EditLogInputStream> |
selectInputStreams(long fromTxId,
long toAtLeastTxId) |
|
java.util.Collection<EditLogInputStream> |
selectInputStreams(long fromTxId,
long toAtLeastTxId,
MetaRecoveryContext recovery,
boolean inProgressOK) |
|
java.util.Collection<EditLogInputStream> |
selectInputStreams(long fromTxId,
long toAtLeastTxId,
MetaRecoveryContext recovery,
boolean inProgressOk,
boolean onlyDurableTxns) |
Select a list of input streams.
|
void |
selectInputStreams(java.util.Collection<EditLogInputStream> streams,
long fromTxId,
boolean inProgressOk,
boolean onlyDurableTxns) |
|
void |
startLogSegment(long txid,
boolean abortCurrentLogSegment,
int layoutVersion) |
Remote namenode just has started a log segment, start log segment locally.
|
public static final org.slf4j.Logger LOG
protected final FSEditLogOp.OpInstanceCache cache
public void initJournalsForWrite()
public void initSharedJournalsForRead()
public boolean isOpenForRead()
protected void beginTransaction(FSEditLogOp op)
public long getLastWrittenTxId()
@VisibleForTesting public long getCurSegmentTxId()
public void logSync()
protected void logSync(long mytxid)
public void logAppendFile(java.lang.String path,
INodeFile file,
boolean newBlock,
boolean toLogRpcIds)
public void logOpenFile(java.lang.String path,
INodeFile newNode,
boolean overwrite,
boolean toLogRpcIds)
public void logCloseFile(java.lang.String path,
INodeFile newNode)
public void logAddBlock(java.lang.String path,
INodeFile file)
public void logUpdateBlocks(java.lang.String path,
INodeFile file,
boolean toLogRpcIds)
public void logMkDir(java.lang.String path,
INode newNode)
@VisibleForTesting public JournalSet getJournalSet()
public RemoteEditLogManifest getEditLogManifest(long fromTxId) throws java.io.IOException
java.io.IOExceptionpublic void startLogSegment(long txid,
boolean abortCurrentLogSegment,
int layoutVersion)
throws java.io.IOException
java.io.IOExceptionpublic void endCurrentLogSegment(boolean writeEndTxn)
public void purgeLogsOlderThan(long minTxIdToKeep)
public long getSyncTxId()
public void journal(long firstTxId,
int numTxns,
byte[] data)
public long getSharedLogCTime()
throws java.io.IOException
java.io.IOExceptionpublic void doPreUpgradeOfSharedLog()
throws java.io.IOException
java.io.IOExceptionpublic void doUpgradeOfSharedLog()
throws java.io.IOException
java.io.IOExceptionpublic void doFinalizeOfSharedLog()
throws java.io.IOException
java.io.IOExceptionpublic boolean canRollBackSharedLog(StorageInfo prevStorage, int targetLayoutVersion) throws java.io.IOException
java.io.IOExceptionpublic void doRollback()
throws java.io.IOException
java.io.IOExceptionpublic void discardSegments(long markerTxid)
throws java.io.IOException
java.io.IOExceptionpublic void selectInputStreams(java.util.Collection<EditLogInputStream> streams, long fromTxId, boolean inProgressOk, boolean onlyDurableTxns) throws java.io.IOException
java.io.IOExceptionpublic java.util.Collection<EditLogInputStream> selectInputStreams(long fromTxId, long toAtLeastTxId) throws java.io.IOException
java.io.IOExceptionpublic java.util.Collection<EditLogInputStream> selectInputStreams(long fromTxId, long toAtLeastTxId, MetaRecoveryContext recovery, boolean inProgressOK) throws java.io.IOException
java.io.IOExceptionpublic java.util.Collection<EditLogInputStream> selectInputStreams(long fromTxId, long toAtLeastTxId, MetaRecoveryContext recovery, boolean inProgressOk, boolean onlyDurableTxns) throws java.io.IOException
fromTxId - first transaction in the selected streamstoAtLeastTxId - the selected streams must contain this transactionrecovery - recovery contextinProgressOk - set to true if in-progress streams are OKonlyDurableTxns - set to true if streams are bounded
by the durable TxIdjava.io.IOException@VisibleForTesting public void restart()
public long getTotalSyncCount()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.