|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.yarn.service.AbstractService
org.apache.hadoop.yarn.service.CompositeService
org.apache.hadoop.mapreduce.v2.app.MRAppMaster
public class MRAppMaster
The Map-Reduce Application Master. The state machine is encapsulated in the implementation of Job interface. All state changes happens via Job interface. Each event results in a Finite State Transition in Job. MR AppMaster is the composition of loosely coupled services. The services interact with each other via events. The components resembles the Actors model. The component acts on received event and send out the events to other components. This keeps it highly concurrent with no or minimal synchronization needs. The events are dispatched by a central Dispatch mechanism. All components register to the Dispatcher. The information is shared across different components using AppContext.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.hadoop.yarn.service.CompositeService |
|---|
org.apache.hadoop.yarn.service.CompositeService.CompositeServiceShutdownHook |
| Nested classes/interfaces inherited from interface org.apache.hadoop.yarn.service.Service |
|---|
org.apache.hadoop.yarn.service.Service.STATE |
| Field Summary | |
|---|---|
protected MRAppMetrics |
metrics
|
| Constructor Summary | |
|---|---|
MRAppMaster(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
org.apache.hadoop.yarn.api.records.ContainerId containerId,
String nmHost,
int nmPort,
int nmHttpPort,
org.apache.hadoop.yarn.Clock clock,
long appSubmitTime)
|
|
MRAppMaster(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
org.apache.hadoop.yarn.api.records.ContainerId containerId,
String nmHost,
int nmPort,
int nmHttpPort,
long appSubmitTime)
|
|
| Method Summary | |
|---|---|
protected void |
addIfService(Object object)
|
void |
cleanupStagingDir()
clean up staging directories for the job. |
protected ClientService |
createClientService(AppContext context)
|
protected ContainerAllocator |
createContainerAllocator(ClientService clientService,
AppContext context)
|
protected ContainerLauncher |
createContainerLauncher(AppContext context)
|
protected org.apache.hadoop.yarn.event.Dispatcher |
createDispatcher()
|
protected Job |
createJob(org.apache.hadoop.conf.Configuration conf)
Create and initialize (but don't start) a single job. |
protected org.apache.hadoop.yarn.event.EventHandler<JobFinishEvent> |
createJobFinishEventHandler()
create an event handler that handles the job finish event. |
protected org.apache.hadoop.yarn.event.EventHandler<JobHistoryEvent> |
createJobHistoryHandler(AppContext context)
|
protected Recovery |
createRecoveryService(AppContext appContext)
Create the recovery service. |
protected Speculator |
createSpeculator(org.apache.hadoop.conf.Configuration conf,
AppContext context)
|
protected TaskAttemptListener |
createTaskAttemptListener(AppContext context)
|
protected TaskCleaner |
createTaskCleaner(AppContext context)
|
protected void |
downloadTokensAndSetupUGI(org.apache.hadoop.conf.Configuration conf)
Obtain the tokens needed by the job and put them in the UGI |
List<org.apache.hadoop.mapreduce.v2.api.records.AMInfo> |
getAllAMInfos()
|
org.apache.hadoop.yarn.api.records.ApplicationId |
getAppID()
|
org.apache.hadoop.yarn.api.records.ApplicationAttemptId |
getAttemptID()
|
org.apache.hadoop.mapreduce.OutputCommitter |
getCommitter()
|
Map<org.apache.hadoop.mapreduce.v2.api.records.TaskId,org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.TaskInfo> |
getCompletedTaskFromPreviousRun()
|
ContainerAllocator |
getContainerAllocator()
|
ContainerLauncher |
getContainerLauncher()
|
AppContext |
getContext()
|
org.apache.hadoop.yarn.event.Dispatcher |
getDispatcher()
|
protected org.apache.hadoop.fs.FileSystem |
getFileSystem(org.apache.hadoop.conf.Configuration conf)
Create the default file System for this job. |
org.apache.hadoop.mapreduce.v2.api.records.JobId |
getJobId()
|
int |
getStartCount()
|
TaskAttemptListener |
getTaskAttemptListener()
|
void |
init(org.apache.hadoop.conf.Configuration conf)
|
protected static void |
initAndStartAppMaster(MRAppMaster appMaster,
org.apache.hadoop.yarn.conf.YarnConfiguration conf,
String jobUserName)
|
boolean |
isNewApiCommitter()
|
protected boolean |
keepJobFiles(org.apache.hadoop.mapred.JobConf conf)
|
static void |
main(String[] args)
|
void |
start()
|
protected void |
startJobs()
This can be overridden to instantiate multiple jobs and create a workflow. |
protected void |
sysexit()
Exit call. |
| Methods inherited from class org.apache.hadoop.yarn.service.CompositeService |
|---|
addService, getServices, removeService, stop |
| Methods inherited from class org.apache.hadoop.yarn.service.AbstractService |
|---|
getConfig, getName, getServiceState, getStartTime, register, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final MRAppMetrics metrics
| Constructor Detail |
|---|
public MRAppMaster(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
org.apache.hadoop.yarn.api.records.ContainerId containerId,
String nmHost,
int nmPort,
int nmHttpPort,
long appSubmitTime)
public MRAppMaster(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
org.apache.hadoop.yarn.api.records.ContainerId containerId,
String nmHost,
int nmPort,
int nmHttpPort,
org.apache.hadoop.yarn.Clock clock,
long appSubmitTime)
| Method Detail |
|---|
public void init(org.apache.hadoop.conf.Configuration conf)
init in interface org.apache.hadoop.yarn.service.Serviceinit in class org.apache.hadoop.yarn.service.CompositeServiceprotected org.apache.hadoop.yarn.event.Dispatcher createDispatcher()
protected boolean keepJobFiles(org.apache.hadoop.mapred.JobConf conf)
protected org.apache.hadoop.fs.FileSystem getFileSystem(org.apache.hadoop.conf.Configuration conf)
throws IOException
conf - the conf object
IOException
public void cleanupStagingDir()
throws IOException
IOExceptionprotected void sysexit()
protected org.apache.hadoop.yarn.event.EventHandler<JobFinishEvent> createJobFinishEventHandler()
protected Recovery createRecoveryService(AppContext appContext)
protected Job createJob(org.apache.hadoop.conf.Configuration conf)
protected void downloadTokensAndSetupUGI(org.apache.hadoop.conf.Configuration conf)
conf - protected void addIfService(Object object)
protected org.apache.hadoop.yarn.event.EventHandler<JobHistoryEvent> createJobHistoryHandler(AppContext context)
protected Speculator createSpeculator(org.apache.hadoop.conf.Configuration conf,
AppContext context)
protected TaskAttemptListener createTaskAttemptListener(AppContext context)
protected TaskCleaner createTaskCleaner(AppContext context)
protected ContainerAllocator createContainerAllocator(ClientService clientService,
AppContext context)
protected ContainerLauncher createContainerLauncher(AppContext context)
protected ClientService createClientService(AppContext context)
public org.apache.hadoop.yarn.api.records.ApplicationId getAppID()
public org.apache.hadoop.yarn.api.records.ApplicationAttemptId getAttemptID()
public org.apache.hadoop.mapreduce.v2.api.records.JobId getJobId()
public org.apache.hadoop.mapreduce.OutputCommitter getCommitter()
public boolean isNewApiCommitter()
public int getStartCount()
public AppContext getContext()
public org.apache.hadoop.yarn.event.Dispatcher getDispatcher()
public Map<org.apache.hadoop.mapreduce.v2.api.records.TaskId,org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.TaskInfo> getCompletedTaskFromPreviousRun()
public List<org.apache.hadoop.mapreduce.v2.api.records.AMInfo> getAllAMInfos()
public ContainerAllocator getContainerAllocator()
public ContainerLauncher getContainerLauncher()
public TaskAttemptListener getTaskAttemptListener()
public void start()
start in interface org.apache.hadoop.yarn.service.Servicestart in class org.apache.hadoop.yarn.service.CompositeServiceprotected void startJobs()
public static void main(String[] args)
protected static void initAndStartAppMaster(MRAppMaster appMaster,
org.apache.hadoop.yarn.conf.YarnConfiguration conf,
String jobUserName)
throws IOException,
InterruptedException
IOException
InterruptedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||