|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.service.AbstractService
org.apache.hadoop.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 | |
|---|---|
class |
MRAppMaster.RunningAppContext
|
| Nested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService |
|---|
org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHook |
| Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service |
|---|
org.apache.hadoop.service.Service.STATE |
| Field Summary | |
|---|---|
protected org.apache.hadoop.security.UserGroupInformation |
currentUser
|
protected boolean |
isLastAMRetry
|
protected MRAppMetrics |
metrics
|
static int |
SHUTDOWN_HOOK_PRIORITY
Priority of the MRAppMaster shutdown hook. |
protected AtomicBoolean |
successfullyUnregistered
|
| Fields inherited from class org.apache.hadoop.service.CompositeService |
|---|
STOP_ONLY_STARTED_SERVICES |
| 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.util.Clock clock,
long appSubmitTime,
int maxAppAttempts)
|
|
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,
int maxAppAttempts)
|
|
| Method Summary | |
|---|---|
void |
cleanupStagingDir()
clean up staging directories for the job. |
protected ClientService |
createClientService(AppContext context)
|
protected org.apache.hadoop.yarn.event.EventHandler<CommitterEvent> |
createCommitterEventHandler(AppContext context,
org.apache.hadoop.mapreduce.OutputCommitter committer)
|
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,
JobStateInternal forcedState,
String diagnostic)
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 Speculator |
createSpeculator(org.apache.hadoop.conf.Configuration conf,
AppContext context)
|
protected org.apache.hadoop.service.AbstractService |
createStagingDirCleaningService()
|
protected TaskAttemptListener |
createTaskAttemptListener(AppContext context)
|
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()
|
protected org.apache.hadoop.security.Credentials |
getCredentials()
|
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()
|
protected RMHeartbeatHandler |
getRMHeartbeatHandler()
|
int |
getStartCount()
|
TaskAttemptListener |
getTaskAttemptListener()
|
protected static void |
initAndStartAppMaster(MRAppMaster appMaster,
org.apache.hadoop.mapred.JobConf conf,
String jobUserName)
|
protected void |
initJobCredentialsAndUGI(org.apache.hadoop.conf.Configuration conf)
Obtain the tokens needed by the job and put them in the UGI |
Boolean |
isLastAMRetry()
|
boolean |
isNewApiCommitter()
|
protected boolean |
keepJobFiles(org.apache.hadoop.mapred.JobConf conf)
|
static void |
main(String[] args)
|
void |
notifyIsLastAMRetry(boolean isLastAMRetry)
|
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf)
|
protected void |
serviceStart()
|
void |
shutDownJob()
|
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.service.CompositeService |
|---|
addIfService, addService, getServices, removeService, 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 |
| Field Detail |
|---|
public static final int SHUTDOWN_HOOK_PRIORITY
protected final MRAppMetrics metrics
protected org.apache.hadoop.security.UserGroupInformation currentUser
protected volatile boolean isLastAMRetry
protected AtomicBoolean successfullyUnregistered
| 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,
int maxAppAttempts)
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.util.Clock clock,
long appSubmitTime,
int maxAppAttempts)
| Method Detail |
|---|
protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws Exception
serviceInit in class org.apache.hadoop.service.CompositeServiceExceptionprotected 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
IOExceptionprotected org.apache.hadoop.security.Credentials getCredentials()
public void cleanupStagingDir()
throws IOException
IOExceptionprotected void sysexit()
public void shutDownJob()
protected org.apache.hadoop.yarn.event.EventHandler<JobFinishEvent> createJobFinishEventHandler()
protected Job createJob(org.apache.hadoop.conf.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(org.apache.hadoop.conf.Configuration conf)
conf - protected org.apache.hadoop.yarn.event.EventHandler<JobHistoryEvent> createJobHistoryHandler(AppContext context)
protected org.apache.hadoop.service.AbstractService createStagingDirCleaningService()
protected Speculator createSpeculator(org.apache.hadoop.conf.Configuration conf,
AppContext context)
protected TaskAttemptListener createTaskAttemptListener(AppContext context)
protected org.apache.hadoop.yarn.event.EventHandler<CommitterEvent> createCommitterEventHandler(AppContext context,
org.apache.hadoop.mapreduce.OutputCommitter committer)
protected ContainerAllocator createContainerAllocator(ClientService clientService,
AppContext context)
protected RMHeartbeatHandler getRMHeartbeatHandler()
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 Boolean isLastAMRetry()
protected void serviceStart()
throws Exception
serviceStart in class org.apache.hadoop.service.CompositeServiceExceptionprotected void startJobs()
public static void main(String[] args)
public void notifyIsLastAMRetry(boolean isLastAMRetry)
protected static void initAndStartAppMaster(MRAppMaster appMaster,
org.apache.hadoop.mapred.JobConf conf,
String jobUserName)
throws IOException,
InterruptedException
IOException
InterruptedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||