diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/FSDownload.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/FSDownload.java index f34c16c997f..6e5957449f2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/FSDownload.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/FSDownload.java @@ -350,6 +350,11 @@ public class FSDownload implements Callable { } catch (URISyntaxException e) { throw new IOException("Invalid resource", e); } + + if (LOG.isDebugEnabled()) { + LOG.debug("Starting to download " + sCopy); + } + createDir(destDirPath, cachePerms); final Path dst_work = new Path(destDirPath + "_tmp"); createDir(dst_work, cachePerms); @@ -364,6 +369,11 @@ public class FSDownload implements Callable { unpack(new File(dTmp.toUri()), new File(dFinal.toUri())); changePermissions(dFinal.getFileSystem(conf), dFinal); files.rename(dst_work, destDirPath, Rename.OVERWRITE); + + if (LOG.isDebugEnabled()) { + LOG.debug("File has been downloaded to " + + new Path(destDirPath, sCopy.getName())); + } } catch (Exception e) { try { files.delete(destDirPath, true); @@ -409,8 +419,11 @@ public class FSDownload implements Callable { // APPLICATION: perm = isDir ? PRIVATE_DIR_PERMS : PRIVATE_FILE_PERMS; } - LOG.debug("Changing permissions for path " + path - + " to perm " + perm); + + if (LOG.isDebugEnabled()) { + LOG.debug("Changing permissions for path " + path + " to perm " + perm); + } + final FsPermission fPerm = perm; if (null == userUgi) { files.setPermission(path, perm); 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 c37f2e3d917..0e7861f6051 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 @@ -859,7 +859,7 @@ public class ResourceLocalizationService extends CompositeService // TODO handle failures, cancellation, requests by other containers LocalizedResource rsrc = request.getResource(); LocalResourceRequest key = rsrc.getRequest(); - LOG.info("Downloading public rsrc:" + key); + LOG.info("Downloading public resource: " + key); /* * Here multiple containers may request the same resource. So we need * to start downloading only when @@ -918,8 +918,17 @@ public class ResourceLocalizationService extends CompositeService + " Either queue is full or threadpool is shutdown.", re); } } else { + if (LOG.isDebugEnabled()) { + LOG.debug("Skip downloading resource: " + key + " since it's in" + + " state: " + rsrc.getState()); + } rsrc.unlock(); } + } else { + if (LOG.isDebugEnabled()) { + LOG.debug("Skip downloading resource: " + key + " since it is locked" + + " by other threads"); + } } }