From fe4bff77e13a4de6a6349e3034b45cfcfd695756 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Vavilapalli Date: Fri, 27 Jan 2012 21:49:15 +0000 Subject: [PATCH] MAPREDUCE-3740. Fixed broken mapreduce compilation after the patch for HADOOP-7965. Contributed by Devaraj K. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1236901 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../yarn/ipc/ProtoOverHadoopRpcEngine.java | 22 +++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index c19ec6f3835..20cbf3b625b 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -79,6 +79,9 @@ Trunk (unreleased changes) MAPREDUCE-3664. Federation Documentation has incorrect configuration example. (Brandon Li via jitendra) + MAPREDUCE-3740. Fixed broken mapreduce compilation after the patch for + HADOOP-7965. (Devaraj K via vinodkv) + Release 0.23.1 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/ProtoOverHadoopRpcEngine.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/ProtoOverHadoopRpcEngine.java index 2c56d318afb..bbece2f34ff 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/ProtoOverHadoopRpcEngine.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/ProtoOverHadoopRpcEngine.java @@ -36,10 +36,12 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.Writable; import org.apache.hadoop.ipc.Client; +import org.apache.hadoop.ipc.ProtocolMetaInfoPB; import org.apache.hadoop.ipc.ProtocolProxy; import org.apache.hadoop.ipc.RPC; import org.apache.hadoop.ipc.RpcEngine; import org.apache.hadoop.ipc.ClientCache; +import org.apache.hadoop.ipc.Client.ConnectionId; import org.apache.hadoop.ipc.RpcPayloadHeader.RpcKind; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.token.SecretManager; @@ -73,6 +75,17 @@ public class ProtoOverHadoopRpcEngine implements RpcEngine { addr, ticket, conf, factory, rpcTimeout)), false); } + @Override + public ProtocolProxy getProtocolMetaInfoProxy( + ConnectionId connId, Configuration conf, SocketFactory factory) + throws IOException { + Class protocol = ProtocolMetaInfoPB.class; + return new ProtocolProxy(protocol, + (ProtocolMetaInfoPB) Proxy.newProxyInstance(protocol.getClassLoader(), + new Class[] { protocol }, new Invoker(protocol, connId, conf, + factory)), false); + } + private static class Invoker implements InvocationHandler, Closeable { private Map returnTypes = new ConcurrentHashMap(); private boolean isClosed = false; @@ -82,8 +95,13 @@ public class ProtoOverHadoopRpcEngine implements RpcEngine { public Invoker(Class protocol, InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, SocketFactory factory, int rpcTimeout) throws IOException { - this.remoteId = Client.ConnectionId.getConnectionId(addr, protocol, - ticket, rpcTimeout, conf); + this(protocol, Client.ConnectionId.getConnectionId(addr, protocol, + ticket, rpcTimeout, conf), conf, factory); + } + + public Invoker(Class protocol, Client.ConnectionId connId, + Configuration conf, SocketFactory factory) { + this.remoteId = connId; this.client = CLIENTS.getClient(conf, factory, ProtoSpecificResponseWritable.class); }