本文整理匯總了Java中org.apache.hadoop.yarn.api.records.ContainerStatus.getDiagnostics方法的典型用法代碼示例。如果您正苦於以下問題:Java ContainerStatus.getDiagnostics方法的具體用法?Java ContainerStatus.getDiagnostics怎麽用?Java ContainerStatus.getDiagnostics使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.yarn.api.records.ContainerStatus
的用法示例。
在下文中一共展示了ContainerStatus.getDiagnostics方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ContainerInfo
import org.apache.hadoop.yarn.api.records.ContainerStatus; //導入方法依賴的package包/類
public ContainerInfo(final Context nmContext, final Container container,
String requestUri, String pathPrefix) {
this.id = container.getContainerId().toString();
this.nodeId = nmContext.getNodeId().toString();
ContainerStatus containerData = container.cloneAndGetContainerStatus();
this.exitCode = containerData.getExitStatus();
this.exitStatus =
(this.exitCode == ContainerExitStatus.INVALID) ?
"N/A" : String.valueOf(exitCode);
this.state = container.getContainerState().toString();
this.diagnostics = containerData.getDiagnostics();
if (this.diagnostics == null || this.diagnostics.isEmpty()) {
this.diagnostics = "";
}
this.user = container.getUser();
Resource res = container.getResource();
if (res != null) {
this.totalMemoryNeededMB = res.getMemory();
this.totalVCoresNeeded = res.getVirtualCores();
}
this.containerLogsShortLink = ujoin("containerlogs", this.id,
container.getUser());
if (requestUri == null) {
requestUri = "";
}
if (pathPrefix == null) {
pathPrefix = "";
}
this.containerLogsLink = join(requestUri, pathPrefix,
this.containerLogsShortLink);
}