Class EditLogTailer

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer

@Private @Evolving public class EditLogTailer extends Object
EditLogTailer represents a thread which periodically reads from edits journals and applies the transactions contained within to a given FSNamesystem.
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
    • DFS_HA_TAILEDITS_MAX_TXNS_PER_LOCK_KEY

      public static final String 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

      public EditLogTailer(FSNamesystem namesystem, org.apache.hadoop.conf.Configuration conf)
  • Method Details

    • start

      public void start()
    • stop

      public void stop() throws IOException
      Throws:
      IOException
    • setEditLog

      @VisibleForTesting public void setEditLog(FSEditLog editLog)
    • catchupDuringFailover

      public void catchupDuringFailover() throws IOException
      Throws:
      IOException
    • doTailEdits

      @VisibleForTesting public long doTailEdits() throws IOException, InterruptedException
      Throws:
      IOException
      InterruptedException
    • getLastLoadTimeMs

      public long getLastLoadTimeMs()
      Returns:
      time in msec of when we last loaded a non-zero number of edits.
    • getCachedActiveProxy

      @VisibleForTesting public NamenodeProtocol getCachedActiveProxy()
    • getLastRollTimeMs

      @VisibleForTesting public long getLastRollTimeMs()
    • getCurrentNN

      @VisibleForTesting public RemoteNameNodeInfo getCurrentNN()
    • setShouldRunForTest

      @VisibleForTesting public void setShouldRunForTest(boolean shouldRun)