Class JobHistory

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.mapreduce.v2.hs.JobHistory
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.mapreduce.v2.app.AppContext, HistoryContext, org.apache.hadoop.service.Service

public class JobHistory extends org.apache.hadoop.service.AbstractService implements HistoryContext
Loads and manages the Job history cache.
  • Field Details

  • Constructor Details

    • JobHistory

      public JobHistory()
  • Method Details

    • serviceInit

      protected void serviceInit(org.apache.hadoop.conf.Configuration conf) throws Exception
      Overrides:
      serviceInit in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • createHistoryStorage

      protected HistoryStorage createHistoryStorage()
    • createHistoryFileManager

      protected HistoryFileManager createHistoryFileManager()
    • serviceStart

      protected void serviceStart() throws Exception
      Overrides:
      serviceStart in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • getInitDelaySecs

      protected int getInitDelaySecs()
    • serviceStop

      protected void serviceStop() throws Exception
      Overrides:
      serviceStop in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • getApplicationName

      public String getApplicationName()
      Specified by:
      getApplicationName in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • getJob

      public org.apache.hadoop.mapreduce.v2.app.job.Job getJob(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId)
      Specified by:
      getJob in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • getAllJobs

      public Map<org.apache.hadoop.mapreduce.v2.api.records.JobId,org.apache.hadoop.mapreduce.v2.app.job.Job> getAllJobs(org.apache.hadoop.yarn.api.records.ApplicationId appID)
      Specified by:
      getAllJobs in interface HistoryContext
    • getAllJobs

      public Map<org.apache.hadoop.mapreduce.v2.api.records.JobId,org.apache.hadoop.mapreduce.v2.app.job.Job> getAllJobs()
      Specified by:
      getAllJobs in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • refreshLoadedJobCache

      public void refreshLoadedJobCache()
    • getPartialJobs

      public JobsInfo getPartialJobs(Long offset, Long count, String user, String queue, Long sBegin, Long sEnd, Long fBegin, Long fEnd, org.apache.hadoop.mapreduce.v2.api.records.JobState jobState)
      Look for a set of partial jobs.
      Specified by:
      getPartialJobs in interface HistoryContext
      Parameters:
      offset - the offset into the list of jobs.
      count - the maximum number of jobs to return.
      user - only return jobs for the given user.
      queue - only return jobs for in the given queue.
      sBegin - only return Jobs that started on or after the given time.
      sEnd - only return Jobs that started on or before the given time.
      fBegin - only return Jobs that ended on or after the given time.
      fEnd - only return Jobs that ended on or before the given time.
      jobState - only return jobs that are in the give job state.
      Returns:
      The list of filtered jobs.
    • refreshJobRetentionSettings

      public void refreshJobRetentionSettings()
    • createConf

      protected org.apache.hadoop.conf.Configuration createConf()
    • getCleanerInterval

      public long getCleanerInterval()
    • getApplicationAttemptId

      public org.apache.hadoop.yarn.api.records.ApplicationAttemptId getApplicationAttemptId()
      Specified by:
      getApplicationAttemptId in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • getApplicationID

      public org.apache.hadoop.yarn.api.records.ApplicationId getApplicationID()
      Specified by:
      getApplicationID in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • getEventHandler

      public org.apache.hadoop.yarn.event.EventHandler<org.apache.hadoop.yarn.event.Event> getEventHandler()
      Specified by:
      getEventHandler in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • getUser

      public CharSequence getUser()
      Specified by:
      getUser in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • getClock

      public org.apache.hadoop.yarn.util.Clock getClock()
      Specified by:
      getClock in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • getClusterInfo

      public org.apache.hadoop.mapreduce.v2.app.ClusterInfo getClusterInfo()
      Specified by:
      getClusterInfo in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • getBlacklistedNodes

      public Set<String> getBlacklistedNodes()
      Specified by:
      getBlacklistedNodes in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • getClientToAMTokenSecretManager

      public org.apache.hadoop.yarn.security.client.ClientToAMTokenSecretManager getClientToAMTokenSecretManager()
      Specified by:
      getClientToAMTokenSecretManager in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • isLastAMRetry

      public boolean isLastAMRetry()
      Specified by:
      isLastAMRetry in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • hasSuccessfullyUnregistered

      public boolean hasSuccessfullyUnregistered()
      Specified by:
      hasSuccessfullyUnregistered in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • getNMHostname

      public String getNMHostname()
      Specified by:
      getNMHostname in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • getTaskAttemptFinishingMonitor

      public org.apache.hadoop.mapreduce.v2.app.TaskAttemptFinishingMonitor getTaskAttemptFinishingMonitor()
      Specified by:
      getTaskAttemptFinishingMonitor in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • getHistoryUrl

      public String getHistoryUrl()
      Specified by:
      getHistoryUrl in interface org.apache.hadoop.mapreduce.v2.app.AppContext
    • setHistoryUrl

      public void setHistoryUrl(String historyUrl)
      Specified by:
      setHistoryUrl in interface org.apache.hadoop.mapreduce.v2.app.AppContext