From 39ec43726841bc56f9d44892405b35bf3c150f0e Mon Sep 17 00:00:00 2001 From: Alejandro Abdelnur Date: Fri, 21 Dec 2012 16:01:48 +0000 Subject: [PATCH] YARN-272. Fair scheduler log messages try to print objects without overridden toString methods. (sandyr via tucu) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1424984 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../hadoop/yarn/api/records/impl/pb/PriorityPBImpl.java | 5 +++++ .../resourcemanager/rmcontainer/RMContainerImpl.java | 7 ++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 2f9146f9e4d..0023635204a 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -143,6 +143,9 @@ Release 2.0.3-alpha - Unreleased YARN-271. Fair scheduler hits IllegalStateException trying to reserve different apps on same node. (Sandy Ryza via tomwhite) + YARN-272. Fair scheduler log messages try to print objects without + overridden toString methods. (sandyr via tucu) + Release 2.0.2-alpha - 2012-09-07 INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/PriorityPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/PriorityPBImpl.java index 9a3f9bb2c95..3c67d66d3af 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/PriorityPBImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/PriorityPBImpl.java @@ -61,5 +61,10 @@ public class PriorityPBImpl extends Priority { maybeInitBuilder(); builder.setPriority((priority)); } + + @Override + public String toString() { + return Integer.valueOf(getPriority()).toString(); + } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmcontainer/RMContainerImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmcontainer/RMContainerImpl.java index de66f583e2a..69ac6012eb8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmcontainer/RMContainerImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmcontainer/RMContainerImpl.java @@ -198,6 +198,11 @@ public class RMContainerImpl implements RMContainer { return reservedPriority; } + @Override + public String toString() { + return containerId.toString(); + } + @Override public void handle(RMContainerEvent event) { LOG.debug("Processing " + event.getContainerId() + " of type " + event.getType()); @@ -221,7 +226,7 @@ public class RMContainerImpl implements RMContainer { writeLock.unlock(); } } - + private static class BaseTransition implements SingleArcTransition {