From 3061bfcde53210d2032df3814243498b27a997b7 Mon Sep 17 00:00:00 2001 From: Wangda Tan Date: Tue, 29 May 2018 09:23:11 -0700 Subject: [PATCH] YARN-8339. Service AM should localize static/archive resource types to container working directory instead of 'resources'. (Suma Shivaprasad via wangda) Change-Id: I9f8e8f621650347f6c2f9e3420edee9eb2f356a4 --- .../apache/hadoop/yarn/service/provider/ProviderUtils.java | 3 +-- .../hadoop/yarn/service/provider/TestProviderUtils.java | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderUtils.java index 1ad5fd8c256..ac909925f0f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderUtils.java @@ -298,8 +298,7 @@ public class ProviderUtils implements YarnServiceConstants { destFile = new Path(staticFile.getDestFile()); } - String symlink = APP_RESOURCES_DIR + "/" + destFile.getName(); - addLocalResource(launcher, symlink, localResource, destFile); + addLocalResource(launcher, destFile.getName(), localResource, destFile); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/provider/TestProviderUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/provider/TestProviderUtils.java index 6e8bc433548..5d794d251c2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/provider/TestProviderUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/provider/TestProviderUtils.java @@ -154,11 +154,11 @@ public class TestProviderUtils { ProviderUtils.handleStaticFilesForLocalization(launcher, sfs, compLaunchCtx); - Mockito.verify(launcher).addLocalResource(Mockito.eq("resources/destFile1"), + Mockito.verify(launcher).addLocalResource(Mockito.eq("destFile1"), any(LocalResource.class)); Mockito.verify(launcher).addLocalResource( - Mockito.eq("resources/destFile_2"), any(LocalResource.class)); + Mockito.eq("destFile_2"), any(LocalResource.class)); Mockito.verify(launcher).addLocalResource( - Mockito.eq("resources/sourceFile4"), any(LocalResource.class)); + Mockito.eq("sourceFile4"), any(LocalResource.class)); } }