public StartContainerEvent(Container container, ContainerLaunchContext containerLaunchContext) { super(container.getId(), container.getNodeId(), container.getContainerToken(), ContainerEventType.START_CONTAINER); this.container = container; this.containerLaunchContext = containerLaunchContext; }
public UpdateContainerResourceEvent(Container container, boolean isIncreaseEvent) { super(container.getId(), container.getNodeId(), container.getContainerToken(), ContainerEventType.UPDATE_CONTAINER_RESOURCE); this.container = container; this.isIncreaseEvent = isIncreaseEvent; }
public IncreaseContainerResourceEvent(Container container) { super(container.getId(), container.getNodeId(), container.getContainerToken(), ContainerEventType.INCREASE_CONTAINER_RESOURCE); this.container = container; }
public StartContainerEvent(Container container, ContainerLaunchContext containerLaunchContext) { super(container.getId(), container.getNodeId(), container.getContainerToken(), ContainerEventType.START_CONTAINER); this.container = container; this.containerLaunchContext = containerLaunchContext; }
public ContainerLauncherLaunchRequestEvent(ContainerLaunchContext clc, Container container, int launcherId, int schedulerId, int taskCommId) { super(container.getId(), container.getNodeId(), container .getContainerToken(), ContainerLauncherEventType.CONTAINER_LAUNCH_REQUEST, launcherId, schedulerId, taskCommId); this.clc = clc; this.container = container; }
public StartContainerEvent(Container container, ContainerLaunchContext containerLaunchContext) { super(container.getId(), container.getNodeId(), container.getContainerToken(), ContainerEventType.START_CONTAINER); this.container = container; this.containerLaunchContext = containerLaunchContext; }
public StartContainerEvent(Container container, ContainerLaunchContext containerLaunchContext) { super(container.getId(), container.getNodeId(), container.getContainerToken(), ContainerEventType.START_CONTAINER); this.container = container; this.containerLaunchContext = containerLaunchContext; }
@Override public String toString() { return "ContainerAllocationEvent [containerId=" + container.getId() + ", nodeId=" + container.getNodeId() + ", containerToken=" + container.getContainerToken() + "]"; }
protected void sendStopRequestToNM() { sendEvent(new ContainerLauncherStopRequestEvent(containerId, container.getNodeId(), container.getContainerToken(), launcherId, schedulerId, taskCommId)); }
public ContainerRemoteLaunchEvent(TaskAttemptId taskAttemptID, ContainerLaunchContext containerLaunchContext, Container allocatedContainer, Task remoteTask) { super(taskAttemptID, allocatedContainer.getId(), StringInterner .weakIntern(allocatedContainer.getNodeId().toString()), allocatedContainer.getContainerToken(), ContainerLauncher.EventType.CONTAINER_REMOTE_LAUNCH); this.allocatedContainer = allocatedContainer; this.containerLaunchContext = containerLaunchContext; this.task = remoteTask; }
public ContainerRemoteLaunchEvent(TaskAttemptId taskAttemptID, ContainerLaunchContext containerLaunchContext, Container allocatedContainer, Task remoteTask) { super(taskAttemptID, allocatedContainer.getId(), StringInterner .weakIntern(allocatedContainer.getNodeId().toString()), allocatedContainer.getContainerToken(), ContainerLauncher.EventType.CONTAINER_REMOTE_LAUNCH); this.allocatedContainer = allocatedContainer; this.containerLaunchContext = containerLaunchContext; this.task = remoteTask; }
public ContainerRemoteLaunchEvent(TaskAttemptId taskAttemptID, ContainerLaunchContext containerLaunchContext, Container allocatedContainer, Task remoteTask) { super(taskAttemptID, allocatedContainer.getId(), StringInterner .weakIntern(allocatedContainer.getNodeId().toString()), allocatedContainer.getContainerToken(), ContainerLauncher.EventType.CONTAINER_REMOTE_LAUNCH); this.allocatedContainer = allocatedContainer; this.containerLaunchContext = containerLaunchContext; this.task = remoteTask; }
@SuppressWarnings("unchecked") private static void sendContainerCompleted(TaskAttemptImpl taskAttempt) { taskAttempt.eventHandler.handle(new ContainerLauncherEvent( taskAttempt.attemptId, taskAttempt.container.getId(), StringInterner .weakIntern(taskAttempt.container.getNodeId().toString()), taskAttempt.container.getContainerToken(), ContainerLauncher.EventType.CONTAINER_COMPLETED)); }
@SuppressWarnings("unchecked") private static void sendContainerCompleted(TaskAttemptImpl taskAttempt) { taskAttempt.eventHandler.handle(new ContainerLauncherEvent( taskAttempt.attemptId, taskAttempt.container.getId(), StringInterner .weakIntern(taskAttempt.container.getNodeId().toString()), taskAttempt.container.getContainerToken(), ContainerLauncher.EventType.CONTAINER_COMPLETED)); }
@SuppressWarnings("unchecked") @Override public void transition(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) { taskAttempt.setFinishTime(); taskAttempt.taskAttemptListener.unregister( taskAttempt.attemptId, taskAttempt.jvmID); taskAttempt.eventHandler.handle(new ContainerLauncherEvent( taskAttempt.attemptId, taskAttempt.getAssignedContainerID(), taskAttempt.getAssignedContainerMgrAddress(), taskAttempt.container.getContainerToken(), ContainerLauncher.EventType.CONTAINER_REMOTE_CLEANUP, false)); taskAttempt.eventHandler.handle(new TaskTAttemptKilledEvent( taskAttempt.attemptId, false)); } }
@SuppressWarnings("unchecked") private static void sendContainerCleanup(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) { if (event instanceof TaskAttemptKillEvent) { taskAttempt.addDiagnosticInfo( ((TaskAttemptKillEvent) event).getMessage()); } //send the cleanup event to containerLauncher taskAttempt.eventHandler.handle(new ContainerLauncherEvent( taskAttempt.attemptId, taskAttempt.container.getId(), StringInterner .weakIntern(taskAttempt.container.getNodeId().toString()), taskAttempt.container.getContainerToken(), ContainerLauncher.EventType.CONTAINER_REMOTE_CLEANUP, event.getType() == TaskAttemptEventType.TA_TIMED_OUT)); }
@SuppressWarnings("unchecked") private static void sendContainerCleanup(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) { if (event instanceof TaskAttemptKillEvent) { taskAttempt.addDiagnosticInfo( ((TaskAttemptKillEvent) event).getMessage()); } //send the cleanup event to containerLauncher taskAttempt.eventHandler.handle(new ContainerLauncherEvent( taskAttempt.attemptId, taskAttempt.container.getId(), StringInterner .weakIntern(taskAttempt.container.getNodeId().toString()), taskAttempt.container.getContainerToken(), ContainerLauncher.EventType.CONTAINER_REMOTE_CLEANUP, event.getType() == TaskAttemptEventType.TA_TIMED_OUT)); }
@SuppressWarnings("unchecked") private static void sendContainerCleanup(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) { if (event instanceof TaskAttemptKillEvent) { taskAttempt.addDiagnosticInfo( ((TaskAttemptKillEvent) event).getMessage()); } taskAttempt.reportedStatus.progress = 1.0f; taskAttempt.updateProgressSplits(); //send the cleanup event to containerLauncher taskAttempt.eventHandler.handle( new ContainerLauncherEvent(taskAttempt.attemptId, taskAttempt.container.getId(), StringInterner .weakIntern(taskAttempt.container.getNodeId().toString()), taskAttempt.container.getContainerToken(), ContainerLauncher.EventType.CONTAINER_REMOTE_CLEANUP)); }
/** * This code is in the dist shell examples -it's been moved here * so that if it is needed, it's still here * @return a remote user with a token to access the container. */ public UserGroupInformation setupUGI() { UserGroupInformation user = UserGroupInformation.createRemoteUser(container.getId().toString()); String cmIpPortStr = container.getNodeId().getHost() + ":" + container.getNodeId().getPort(); final InetSocketAddress cmAddress = NetUtils.createSocketAddr(cmIpPortStr); org.apache.hadoop.yarn.api.records.Token containerToken = container.getContainerToken(); if (containerToken != null) { Token<ContainerTokenIdentifier> token = ConverterUtils.convertFromYarn(containerToken, cmAddress); user.addToken(token); } return user; }
/** * This code is in the dist shell examples -it's been moved here * so that if it is needed, it's still here * @return a remote user with a token to access the container. */ public UserGroupInformation setupUGI() { UserGroupInformation user = UserGroupInformation.createRemoteUser(container.getId().toString()); String cmIpPortStr = container.getNodeId().getHost() + ":" + container.getNodeId().getPort(); final InetSocketAddress cmAddress = NetUtils.createSocketAddr(cmIpPortStr); org.apache.hadoop.yarn.api.records.Token containerToken = container.getContainerToken(); if (containerToken != null) { Token<ContainerTokenIdentifier> token = ConverterUtils.convertFromYarn(containerToken, cmAddress); user.addToken(token); } return user; }