YARN-4439. Clarify NMContainerStatus#toString method. Contributed by Jian He

This commit is contained in:
Jason Lowe 2015-12-15 18:06:13 +00:00
parent 97a20ff2c6
commit 8ab642989c
2 changed files with 12 additions and 3 deletions

View File

@ -46,6 +46,8 @@ Release 2.7.3 - UNRELEASED
YARN-4422. Generic AHS sometimes doesn't show started, node, or logs on App page
(Eric Payne via jeagles)
YARN-4439. Clarify NMContainerStatus#toString method. (Jian He via xgong)
MAPREDUCE-6436. JobHistory cache issue. (Kai Sasaki via zxu)
Release 2.7.2 - UNRELEASED

View File

@ -34,8 +34,6 @@ import org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NMContainerSta
import org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NMContainerStatusProtoOrBuilder;
import org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus;
import com.google.protobuf.TextFormat;
public class NMContainerStatusPBImpl extends NMContainerStatus {
NMContainerStatusProto proto = NMContainerStatusProto
@ -81,7 +79,16 @@ public class NMContainerStatusPBImpl extends NMContainerStatus {
@Override
public String toString() {
return TextFormat.shortDebugString(getProto());
StringBuilder sb = new StringBuilder();
sb.append("[").append(getContainerId()).append(", ")
.append("CreateTime: ").append(getCreationTime()).append(", ")
.append("State: ").append(getContainerState()).append(", ")
.append("Capability: ").append(getAllocatedResource()).append(", ")
.append("Diagnostics: ").append(getDiagnostics()).append(", ")
.append("ExitStatus: ").append(getContainerExitStatus()).append(", ")
.append("Priority: ").append(getPriority())
.append("]");
return sb.toString();
}
@Override