public class JobHistory extends AbstractService implements HistoryContext
Service.STATE
Modifier and Type | Field and Description |
---|---|
static Pattern |
CONF_FILENAME_REGEX |
static String |
OLD_SUFFIX |
Constructor and Description |
---|
JobHistory() |
Modifier and Type | Method and Description |
---|---|
Map<JobId,Job> |
getAllJobs() |
Map<JobId,Job> |
getAllJobs(ApplicationId appID) |
ApplicationAttemptId |
getApplicationAttemptId() |
ApplicationId |
getApplicationID() |
String |
getApplicationName() |
Set<String> |
getBlacklistedNodes() |
ClientToAMTokenSecretManager |
getClientToAMTokenSecretManager() |
Clock |
getClock() |
ClusterInfo |
getClusterInfo() |
EventHandler |
getEventHandler() |
Job |
getJob(JobId jobId) |
JobsInfo |
getPartialJobs(Long offset,
Long count,
String user,
String queue,
Long sBegin,
Long sEnd,
Long fBegin,
Long fEnd,
JobState jobState)
Look for a set of partial jobs.
|
CharSequence |
getUser() |
boolean |
hasSuccessfullyUnregistered() |
boolean |
isLastAMRetry() |
protected void |
serviceInit(Configuration conf)
All initialization code needed by a service.
|
protected void |
serviceStart()
Actions called during the INITED to STARTED transition.
|
protected void |
serviceStop()
Actions called during the transition to the STOPPED state.
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getStartTime
public static final Pattern CONF_FILENAME_REGEX
public static final String OLD_SUFFIX
protected void serviceInit(Configuration conf) throws Exception
AbstractService
AbstractService.init(Configuration)
prevents re-entrancy.
The base implementation checks to see if the subclass has created
a new configuration instance, and if so, updates the base class valueserviceInit
in class AbstractService
conf
- configurationException
- on a failure -these will be caught,
possibly wrapped, and wil; trigger a service stopprotected void serviceStart() throws Exception
AbstractService
AbstractService.start()
prevents re-entrancy.serviceStart
in class AbstractService
Exception
- if needed -these will be caught,
wrapped, and trigger a service stopprotected void serviceStop() throws Exception
AbstractService
AbstractService.stop()
prevents re-entrancy.
Implementations MUST write this to be robust against failures, including
checks for null references -and for the first failure to not stop other
attempts to shut down parts of the service.serviceStop
in class AbstractService
Exception
- if needed -these will be caught and logged.public String getApplicationName()
getApplicationName
in interface AppContext
public Job getJob(JobId jobId)
getJob
in interface AppContext
public Map<JobId,Job> getAllJobs(ApplicationId appID)
getAllJobs
in interface HistoryContext
public Map<JobId,Job> getAllJobs()
getAllJobs
in interface AppContext
public JobsInfo getPartialJobs(Long offset, Long count, String user, String queue, Long sBegin, Long sEnd, Long fBegin, Long fEnd, JobState jobState)
getPartialJobs
in interface HistoryContext
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.public ApplicationAttemptId getApplicationAttemptId()
getApplicationAttemptId
in interface AppContext
public ApplicationId getApplicationID()
getApplicationID
in interface AppContext
public EventHandler getEventHandler()
getEventHandler
in interface AppContext
public CharSequence getUser()
getUser
in interface AppContext
public Clock getClock()
getClock
in interface AppContext
public ClusterInfo getClusterInfo()
getClusterInfo
in interface AppContext
public Set<String> getBlacklistedNodes()
getBlacklistedNodes
in interface AppContext
public ClientToAMTokenSecretManager getClientToAMTokenSecretManager()
getClientToAMTokenSecretManager
in interface AppContext
public boolean isLastAMRetry()
isLastAMRetry
in interface AppContext
public boolean hasSuccessfullyUnregistered()
hasSuccessfullyUnregistered
in interface AppContext
Copyright © 2013 Apache Software Foundation. All rights reserved.