Java Code Examples for org.apache.hadoop.yarn.api.records.ContainerStatus#setExitStatus()
The following examples show how to use
org.apache.hadoop.yarn.api.records.ContainerStatus#setExitStatus() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestRPC.java From hadoop with Apache License 2.0 | 6 votes |
@Override public StartContainersResponse startContainers( StartContainersRequest requests) throws YarnException { StartContainersResponse response = recordFactory.newRecordInstance(StartContainersResponse.class); for (StartContainerRequest request : requests.getStartContainerRequests()) { Token containerToken = request.getContainerToken(); ContainerTokenIdentifier tokenId = null; try { tokenId = newContainerTokenIdentifier(containerToken); } catch (IOException e) { throw RPCUtil.getRemoteException(e); } ContainerStatus status = recordFactory.newRecordInstance(ContainerStatus.class); status.setState(ContainerState.RUNNING); status.setContainerId(tokenId.getContainerID()); status.setExitStatus(0); statuses.add(status); } return response; }
Example 2
Source File: TestRPC.java From big-c with Apache License 2.0 | 6 votes |
@Override public StartContainersResponse startContainers( StartContainersRequest requests) throws YarnException { StartContainersResponse response = recordFactory.newRecordInstance(StartContainersResponse.class); for (StartContainerRequest request : requests.getStartContainerRequests()) { Token containerToken = request.getContainerToken(); ContainerTokenIdentifier tokenId = null; try { tokenId = newContainerTokenIdentifier(containerToken); } catch (IOException e) { throw RPCUtil.getRemoteException(e); } ContainerStatus status = recordFactory.newRecordInstance(ContainerStatus.class); status.setState(ContainerState.RUNNING); status.setContainerId(tokenId.getContainerID()); status.setExitStatus(0); statuses.add(status); } return response; }
Example 3
Source File: BuilderUtils.java From hadoop with Apache License 2.0 | 5 votes |
public static ContainerStatus newContainerStatus(ContainerId containerId, ContainerState containerState, String diagnostics, int exitStatus) { ContainerStatus containerStatus = recordFactory .newRecordInstance(ContainerStatus.class); containerStatus.setState(containerState); containerStatus.setContainerId(containerId); containerStatus.setDiagnostics(diagnostics); containerStatus.setExitStatus(exitStatus); return containerStatus; }
Example 4
Source File: MockContainer.java From hadoop with Apache License 2.0 | 5 votes |
@Override public ContainerStatus cloneAndGetContainerStatus() { ContainerStatus containerStatus = recordFactory .newRecordInstance(ContainerStatus.class); containerStatus .setState(org.apache.hadoop.yarn.api.records.ContainerState.RUNNING); containerStatus.setDiagnostics("testing"); containerStatus.setExitStatus(0); return containerStatus; }
Example 5
Source File: SchedulerUtils.java From hadoop with Apache License 2.0 | 5 votes |
/** * Utility to create a {@link ContainerStatus} during exceptional * circumstances. * * @param containerId {@link ContainerId} of returned/released/lost container. * @param diagnostics diagnostic message * @return <code>ContainerStatus</code> for an returned/released/lost * container */ private static ContainerStatus createAbnormalContainerStatus( ContainerId containerId, int exitStatus, String diagnostics) { ContainerStatus containerStatus = recordFactory.newRecordInstance(ContainerStatus.class); containerStatus.setContainerId(containerId); containerStatus.setDiagnostics(diagnostics); containerStatus.setExitStatus(exitStatus); containerStatus.setState(ContainerState.COMPLETE); return containerStatus; }
Example 6
Source File: NMSimulator.java From hadoop with Apache License 2.0 | 5 votes |
private ContainerStatus newContainerStatus(ContainerId cId, ContainerState state, int exitState) { ContainerStatus cs = Records.newRecord(ContainerStatus.class); cs.setContainerId(cId); cs.setState(state); cs.setExitStatus(exitState); return cs; }
Example 7
Source File: BuilderUtils.java From big-c with Apache License 2.0 | 5 votes |
public static ContainerStatus newContainerStatus(ContainerId containerId, ContainerState containerState, String diagnostics, int exitStatus) { ContainerStatus containerStatus = recordFactory .newRecordInstance(ContainerStatus.class); containerStatus.setState(containerState); containerStatus.setContainerId(containerId); containerStatus.setDiagnostics(diagnostics); containerStatus.setExitStatus(exitStatus); return containerStatus; }
Example 8
Source File: MockContainer.java From big-c with Apache License 2.0 | 5 votes |
@Override public ContainerStatus cloneAndGetContainerStatus() { ContainerStatus containerStatus = recordFactory .newRecordInstance(ContainerStatus.class); containerStatus .setState(org.apache.hadoop.yarn.api.records.ContainerState.RUNNING); containerStatus.setDiagnostics("testing"); containerStatus.setExitStatus(0); return containerStatus; }
Example 9
Source File: SchedulerUtils.java From big-c with Apache License 2.0 | 5 votes |
/** * Utility to create a {@link ContainerStatus} during exceptional * circumstances. * * @param containerId {@link ContainerId} of returned/released/lost container. * @param diagnostics diagnostic message * @return <code>ContainerStatus</code> for an returned/released/lost * container */ private static ContainerStatus createAbnormalContainerStatus( ContainerId containerId, int exitStatus, String diagnostics) { ContainerStatus containerStatus = recordFactory.newRecordInstance(ContainerStatus.class); containerStatus.setContainerId(containerId); containerStatus.setDiagnostics(diagnostics); containerStatus.setExitStatus(exitStatus); containerStatus.setState(ContainerState.COMPLETE); return containerStatus; }
Example 10
Source File: NMSimulator.java From big-c with Apache License 2.0 | 5 votes |
private ContainerStatus newContainerStatus(ContainerId cId, ContainerState state, int exitState) { ContainerStatus cs = Records.newRecord(ContainerStatus.class); cs.setContainerId(cId); cs.setState(state); cs.setExitStatus(exitState); return cs; }