YARN-4439. Clarify NMContainerStatus#toString method. Contributed by
Jian He (cherry picked from commitd8a45425eb
) (cherry picked from commit992f65dd8b
)
This commit is contained in:
parent
4bc1aab49d
commit
f22d0046de
|
@ -1083,6 +1083,8 @@ Release 2.7.3 - UNRELEASED
|
||||||
YARN-4380. TestResourceLocalizationService.testDownloadingResourcesOnContainerKill
|
YARN-4380. TestResourceLocalizationService.testDownloadingResourcesOnContainerKill
|
||||||
fails intermittently. (Varun Saxena via ozawa)
|
fails intermittently. (Varun Saxena via ozawa)
|
||||||
|
|
||||||
|
YARN-4439. Clarify NMContainerStatus#toString method. (Jian He via xgong)
|
||||||
|
|
||||||
Release 2.7.2 - UNRELEASED
|
Release 2.7.2 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -35,8 +35,6 @@ import org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NMContainerSta
|
||||||
import org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NMContainerStatusProtoOrBuilder;
|
import org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NMContainerStatusProtoOrBuilder;
|
||||||
import org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus;
|
import org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus;
|
||||||
|
|
||||||
import com.google.protobuf.TextFormat;
|
|
||||||
|
|
||||||
public class NMContainerStatusPBImpl extends NMContainerStatus {
|
public class NMContainerStatusPBImpl extends NMContainerStatus {
|
||||||
|
|
||||||
NMContainerStatusProto proto = NMContainerStatusProto
|
NMContainerStatusProto proto = NMContainerStatusProto
|
||||||
|
@ -82,7 +80,17 @@ public class NMContainerStatusPBImpl extends NMContainerStatus {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
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("NodeLabelExpression: ").append(getNodeLabelExpression())
|
||||||
|
.append("Priority: ").append(getPriority())
|
||||||
|
.append("]");
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue