NodeManager:
成员:
ContainerManagerImpl containerManager:管理容器。
Map<ApplicationId, List<Container>> containers:保持RM发送的容器信息。
ContainerManagerImpl:
StartContainersResponse():RPC接口实现,接受ResourceManager发送的创建ApplicationMaster的信息。
startContainerInternal():创建两个对象ApplicationImpl和ContainerImpl。
ApplicationImpl:
public enum ApplicationState {
NEW, INITING, RUNNING, FINISHING_CONTAINERS_WAIT, APPLICATION_RESOURCES_CLEANINGUP, FINISHED
}
ContainerImpl:
public enum ContainerState {
// NOTE: In case of future additions / deletions / modifications to this
// enum, please ensure that the following are also correspondingly
// updated:
// 1. ContainerImpl::getContainerSubState().
// 2. the doc in the ContainerSubState class.
// 3. the doc in the yarn_protos.proto file.
NEW, LOCALIZING, LOCALIZATION_FAILED, SCHEDULED, RUNNING, RELAUNCHING,
REINITIALIZING, REINITIALIZING_AWAITING_KILL,
EXITED_WITH_SUCCESS, EXITED_WITH_FAILURE, KILLING,
CONTAINER_CLEANEDUP_AFTER_KILL, CONTAINER_RESOURCES_CLEANINGUP, DONE,
PAUSING, PAUSED, RESUMING
}
ApplicationMaster:
成员:
AMRMClientAsync amRMClient:与ResourceManager 进行通讯。
AMRMClientAsync:
成员:
HeartbeatThread heartbeatThread:
CallbackHandlerThread handlerThread:
registerApplicationMaster():向RM上的ApplicationMasterService注册。