From 93b29d962d75ce8a491c11dfadf906400458b0d4 Mon Sep 17 00:00:00 2001 From: Karthik Kambatla Date: Tue, 31 Mar 2015 17:34:40 -0700 Subject: [PATCH] YARN-3428. Debug log resources to be localized for a container. (kasha) (cherry picked from commit 2daa478a6420585dc13cea2111580ed5fe347bc1) --- hadoop-yarn-project/CHANGES.txt | 2 ++ .../localizer/ResourceLocalizationService.java | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 273a788aaeb..30c1826739e 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -41,6 +41,8 @@ Release 2.8.0 - UNRELEASED YARN-3258. FairScheduler: Need to add more logging to investigate allocations. (Anubhav Dhoot via ozawa) + YARN-3428. Debug log resources to be localized for a container. (kasha) + OPTIMIZATIONS YARN-3339. TestDockerContainerExecutor should pull a single image and not diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java index dd50eadf458..42363921910 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java @@ -448,6 +448,10 @@ public class ResourceLocalizationService extends CompositeService .getApplicationId()); for (LocalResourceRequest req : e.getValue()) { tracker.handle(new ResourceRequestEvent(req, e.getKey(), ctxt)); + if (LOG.isDebugEnabled()) { + LOG.debug("Localizing " + req.getPath() + + " for container " + c.getContainerId()); + } } } } @@ -456,10 +460,14 @@ public class ResourceLocalizationService extends CompositeService ResourceRetentionSet retain = new ResourceRetentionSet(delService, cacheTargetSize); retain.addResources(publicRsrc); - LOG.debug("Resource cleanup (public) " + retain); + if (LOG.isDebugEnabled()) { + LOG.debug("Resource cleanup (public) " + retain); + } for (LocalResourcesTracker t : privateRsrc.values()) { retain.addResources(t); - LOG.debug("Resource cleanup " + t.getUser() + ":" + retain); + if (LOG.isDebugEnabled()) { + LOG.debug("Resource cleanup " + t.getUser() + ":" + retain); + } } //TODO Check if appRsrcs should also be added to the retention set. }