Class EditLogTailer
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer
EditLogTailer represents a thread which periodically reads from edits
journals and applies the transactions contained within to a given
FSNamesystem.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final StringStandbyNode will hold namesystem lock to apply at most this many journal transactions.static final org.slf4j.Logger -
Constructor Summary
ConstructorsConstructorDescriptionEditLogTailer(FSNamesystem namesystem, org.apache.hadoop.conf.Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionvoidlonglonglongvoidsetEditLog(FSEditLog editLog) voidsetShouldRunForTest(boolean shouldRun) voidstart()voidstop()
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG -
DFS_HA_TAILEDITS_MAX_TXNS_PER_LOCK_KEY
StandbyNode will hold namesystem lock to apply at most this many journal transactions. It will then release the lock and re-acquire it to load more transactions. By default the write lock is held for the entire journal segment. Fine-grained locking allows read requests to get through.- See Also:
-
DFS_HA_TAILEDITS_MAX_TXNS_PER_LOCK_DEFAULT
public static final long DFS_HA_TAILEDITS_MAX_TXNS_PER_LOCK_DEFAULT- See Also:
-
-
Constructor Details
-
EditLogTailer
-
-
Method Details
-
start
public void start() -
stop
- Throws:
IOException
-
setEditLog
-
catchupDuringFailover
- Throws:
IOException
-
doTailEdits
- Throws:
IOExceptionInterruptedException
-
getLastLoadTimeMs
public long getLastLoadTimeMs()- Returns:
- time in msec of when we last loaded a non-zero number of edits.
-
getCachedActiveProxy
-
getLastRollTimeMs
@VisibleForTesting public long getLastRollTimeMs() -
getCurrentNN
-
setShouldRunForTest
@VisibleForTesting public void setShouldRunForTest(boolean shouldRun)
-