public class MRAppMaster extends CompositeService
Modifier and Type | Class and Description |
---|---|
class |
MRAppMaster.RunningAppContext |
CompositeService.CompositeServiceShutdownHook
Service.STATE
Modifier and Type | Field and Description |
---|---|
protected UserGroupInformation |
currentUser |
protected boolean |
isLastAMRetry |
protected MRAppMetrics |
metrics |
static int |
SHUTDOWN_HOOK_PRIORITY
Priority of the MRAppMaster shutdown hook.
|
protected AtomicBoolean |
successfullyUnregistered |
STOP_ONLY_STARTED_SERVICES
Constructor and Description |
---|
MRAppMaster(ApplicationAttemptId applicationAttemptId,
ContainerId containerId,
String nmHost,
int nmPort,
int nmHttpPort,
Clock clock,
long appSubmitTime,
int maxAppAttempts) |
MRAppMaster(ApplicationAttemptId applicationAttemptId,
ContainerId containerId,
String nmHost,
int nmPort,
int nmHttpPort,
long appSubmitTime,
int maxAppAttempts) |
addIfService, addService, getServices, removeService, serviceStop
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
public static final int SHUTDOWN_HOOK_PRIORITY
protected final MRAppMetrics metrics
protected UserGroupInformation currentUser
protected volatile boolean isLastAMRetry
protected AtomicBoolean successfullyUnregistered
public MRAppMaster(ApplicationAttemptId applicationAttemptId, ContainerId containerId, String nmHost, int nmPort, int nmHttpPort, long appSubmitTime, int maxAppAttempts)
public MRAppMaster(ApplicationAttemptId applicationAttemptId, ContainerId containerId, String nmHost, int nmPort, int nmHttpPort, Clock clock, long appSubmitTime, int maxAppAttempts)
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 CompositeService
conf
- configurationException
- on a failure -these will be caught,
possibly wrapped, and wil; trigger a service stopprotected Dispatcher createDispatcher()
protected boolean keepJobFiles(JobConf conf)
protected FileSystem getFileSystem(Configuration conf) throws IOException
conf
- the conf objectIOException
protected Credentials getCredentials()
public void cleanupStagingDir() throws IOException
IOException
protected void sysexit()
public void shutDownJob()
protected EventHandler<JobFinishEvent> createJobFinishEventHandler()
protected Job createJob(Configuration conf, JobStateInternal forcedState, String diagnostic)
forcedState
- a state to force the job into or null for normal operation.diagnostic
- a diagnostic message to include with the job.protected void initJobCredentialsAndUGI(Configuration conf)
conf
- protected EventHandler<JobHistoryEvent> createJobHistoryHandler(AppContext context)
protected AbstractService createStagingDirCleaningService()
protected Speculator createSpeculator(Configuration conf, AppContext context)
protected TaskAttemptListener createTaskAttemptListener(AppContext context)
protected EventHandler<CommitterEvent> createCommitterEventHandler(AppContext context, OutputCommitter committer)
protected ContainerAllocator createContainerAllocator(ClientService clientService, AppContext context)
protected RMHeartbeatHandler getRMHeartbeatHandler()
protected ContainerLauncher createContainerLauncher(AppContext context)
protected ClientService createClientService(AppContext context)
public ApplicationId getAppID()
public ApplicationAttemptId getAttemptID()
public JobId getJobId()
public OutputCommitter getCommitter()
public boolean isNewApiCommitter()
public int getStartCount()
public AppContext getContext()
public Dispatcher getDispatcher()
public Map<TaskId,JobHistoryParser.TaskInfo> getCompletedTaskFromPreviousRun()
public ContainerAllocator getContainerAllocator()
public ContainerLauncher getContainerLauncher()
public TaskAttemptListener getTaskAttemptListener()
public Boolean isLastAMRetry()
protected void serviceStart() throws Exception
AbstractService
AbstractService.start()
prevents re-entrancy.serviceStart
in class CompositeService
Exception
- if needed -these will be caught,
wrapped, and trigger a service stopprotected void startJobs()
public static void main(String[] args)
public void notifyIsLastAMRetry(boolean isLastAMRetry)
protected static void initAndStartAppMaster(MRAppMaster appMaster, JobConf conf, String jobUserName) throws IOException, InterruptedException
IOException
InterruptedException
Copyright © 2013 Apache Software Foundation. All rights reserved.