org.apache.hadoop.mapreduce.v2.hs
Class JobHistory

java.lang.Object
  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.mapreduce.v2.hs.JobHistory
All Implemented Interfaces:
Closeable, 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.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE
 
Field Summary
static Pattern CONF_FILENAME_REGEX
           
static String OLD_SUFFIX
           
 
Constructor Summary
JobHistory()
           
 
Method Summary
protected  org.apache.hadoop.conf.Configuration createConf()
           
protected  HistoryFileManager createHistoryFileManager()
           
protected  HistoryStorage createHistoryStorage()
           
 Map<org.apache.hadoop.mapreduce.v2.api.records.JobId,org.apache.hadoop.mapreduce.v2.app.job.Job> getAllJobs()
           
 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)
           
 org.apache.hadoop.yarn.api.records.ApplicationAttemptId getApplicationAttemptId()
           
 org.apache.hadoop.yarn.api.records.ApplicationId getApplicationID()
           
 String getApplicationName()
           
 Set<String> getBlacklistedNodes()
           
 long getCleanerInterval()
           
 org.apache.hadoop.yarn.security.client.ClientToAMTokenSecretManager getClientToAMTokenSecretManager()
           
 org.apache.hadoop.yarn.util.Clock getClock()
           
 org.apache.hadoop.mapreduce.v2.app.ClusterInfo getClusterInfo()
           
 org.apache.hadoop.yarn.event.EventHandler getEventHandler()
           
protected  int getInitDelaySecs()
           
 org.apache.hadoop.mapreduce.v2.app.job.Job getJob(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId)
           
 String getNMHostname()
           
 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.
 CharSequence getUser()
           
 boolean hasSuccessfullyUnregistered()
           
 boolean isLastAMRetry()
           
 void refreshJobRetentionSettings()
           
 void refreshLoadedJobCache()
           
protected  void serviceInit(org.apache.hadoop.conf.Configuration conf)
           
protected  void serviceStart()
           
protected  void serviceStop()
           
 
Methods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.mapreduce.v2.app.AppContext
getStartTime
 

Field Detail

CONF_FILENAME_REGEX

public static final Pattern CONF_FILENAME_REGEX

OLD_SUFFIX

public static final String OLD_SUFFIX
See Also:
Constant Field Values
Constructor Detail

JobHistory

public JobHistory()
Method Detail

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 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


Copyright © 2014 Apache Software Foundation. All Rights Reserved.