From 570eee30e5ab5cf37b1a758934987cbf61140f6a Mon Sep 17 00:00:00 2001 From: Weiwei Yang Date: Tue, 2 Jul 2019 09:55:25 +0800 Subject: [PATCH] YARN-9655. AllocateResponse in FederationInterceptor lost applicationPriority. Contributed by hunshenshi. --- .../server/nodemanager/amrmproxy/FederationInterceptor.java | 5 +++++ .../nodemanager/amrmproxy/TestFederationInterceptor.java | 1 + 2 files changed, 6 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/FederationInterceptor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/FederationInterceptor.java index 992dc823dfc..5d165c99584 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/FederationInterceptor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/FederationInterceptor.java @@ -1446,6 +1446,11 @@ public class FederationInterceptor extends AbstractRequestInterceptor { } } + if (otherResponse.getApplicationPriority() != null) { + homeResponse.setApplicationPriority( + otherResponse.getApplicationPriority()); + } + homeResponse.setNumClusterNodes( homeResponse.getNumClusterNodes() + otherResponse.getNumClusterNodes()); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/TestFederationInterceptor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/TestFederationInterceptor.java index ecaeaae7bf9..3288382b26d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/TestFederationInterceptor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/TestFederationInterceptor.java @@ -748,6 +748,7 @@ public class TestFederationInterceptor extends BaseAMRMProxyTest { Assert.assertEquals(1, response.getNMTokens().size()); Assert.assertEquals(1, response.getUpdatedContainers().size()); Assert.assertEquals(1, response.getUpdateErrors().size()); + Assert.assertNotNull(response.getApplicationPriority()); } @Test