From 8006467e58775ab2404be713f45efeea023819fd Mon Sep 17 00:00:00 2001 From: Karthik Kambatla Date: Tue, 28 Jan 2014 08:26:33 +0000 Subject: [PATCH] YARN-1642. RMDTRenewer#getRMClient should use ClientRMProxy (kasha) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1561990 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 2 ++ .../yarn/security/client/RMDelegationTokenIdentifier.java | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index c36f1ee67a..84706a8f32 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -463,6 +463,8 @@ Release 2.4.0 - UNRELEASED YARN-1575. Public localizer crashes with "Localized unkown resource" (jlowe) + YARN-1642. RMDTRenewer#getRMClient should use ClientRMProxy (kasha) + Release 2.3.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/client/RMDelegationTokenIdentifier.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/client/RMDelegationTokenIdentifier.java index 094c133860..418ccb2141 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/client/RMDelegationTokenIdentifier.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/client/RMDelegationTokenIdentifier.java @@ -37,8 +37,8 @@ import org.apache.hadoop.yarn.api.ApplicationClientProtocol; import org.apache.hadoop.yarn.api.protocolrecords.CancelDelegationTokenRequest; import org.apache.hadoop.yarn.api.protocolrecords.RenewDelegationTokenRequest; +import org.apache.hadoop.yarn.client.ClientRMProxy; import org.apache.hadoop.yarn.exceptions.YarnException; -import org.apache.hadoop.yarn.ipc.YarnRPC; import org.apache.hadoop.yarn.util.Records; /** @@ -138,7 +138,7 @@ public void cancel(Token token, Configuration conf) throws IOException, } private static ApplicationClientProtocol getRmClient(Token token, - Configuration conf) { + Configuration conf) throws IOException { InetSocketAddress addr = SecurityUtil.getTokenServiceAddr(token); if (localSecretManager != null) { // return null if it's our token @@ -151,8 +151,7 @@ private static ApplicationClientProtocol getRmClient(Token token, return null; } } - final YarnRPC rpc = YarnRPC.create(conf); - return (ApplicationClientProtocol)rpc.getProxy(ApplicationClientProtocol.class, addr, conf); + return ClientRMProxy.createRMProxy(conf, ApplicationClientProtocol.class); } // get renewer so we can always renew our own tokens