Return-Path: Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: (qmail 41987 invoked from network); 4 Mar 2011 03:39:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Mar 2011 03:39:56 -0000 Received: (qmail 64619 invoked by uid 500); 4 Mar 2011 03:39:56 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 64596 invoked by uid 500); 4 Mar 2011 03:39:56 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 64588 invoked by uid 99); 4 Mar 2011 03:39:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 03:39:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 03:39:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EBD842388C0F; Fri, 4 Mar 2011 03:39:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1077091 - /hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/ipc/RPC.java Date: Fri, 04 Mar 2011 03:39:31 -0000 To: common-commits@hadoop.apache.org From: omalley@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110304033931.EBD842388C0F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: omalley Date: Fri Mar 4 03:39:31 2011 New Revision: 1077091 URL: http://svn.apache.org/viewvc?rev=1077091&view=rev Log: commit 00285e9930bee667aeabc78e71f7c56df77409e4 Author: Jitendra Nath Pandey Date: Thu Dec 24 11:46:03 2009 -0800 HADOOP-6132 from https://issues.apache.org/jira/secure/attachment/12428925/HADOOP-6132-0_20.1.patch +++ b/YAHOO-CHANGES.txt + HADOOP-6132. RPC client opens an extra connection for VersionedProtocol. + (Jitendra Nath Pandey) + Modified: hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/ipc/RPC.java Modified: hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/ipc/RPC.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/ipc/RPC.java?rev=1077091&r1=1077090&r2=1077091&view=diff ============================================================================== --- hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/ipc/RPC.java (original) +++ hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/ipc/RPC.java Fri Mar 4 03:39:31 2011 @@ -197,13 +197,16 @@ public class RPC { private static ClientCache CLIENTS=new ClientCache(); private static class Invoker implements InvocationHandler { + private Class protocol; private InetSocketAddress address; private UserGroupInformation ticket; private Client client; private boolean isClosed = false; - public Invoker(InetSocketAddress address, UserGroupInformation ticket, - Configuration conf, SocketFactory factory) { + public Invoker(Class protocol, + InetSocketAddress address, UserGroupInformation ticket, + Configuration conf, SocketFactory factory) { + this.protocol = protocol; this.address = address; this.ticket = ticket; this.client = CLIENTS.getClient(conf, factory); @@ -219,7 +222,7 @@ public class RPC { ObjectWritable value = (ObjectWritable) client.call(new Invocation(method, args), address, - method.getDeclaringClass(), ticket); + protocol, ticket); if (logDebug) { long callTime = System.currentTimeMillis() - startTime; LOG.debug("Call: " + method.getName() + " " + callTime); @@ -283,7 +286,8 @@ public class RPC { } } - public static VersionedProtocol waitForProxy(Class protocol, + public static VersionedProtocol waitForProxy( + Class protocol, long clientVersion, InetSocketAddress addr, Configuration conf @@ -301,7 +305,8 @@ public class RPC { * @return the proxy * @throws IOException if the far end through a RemoteException */ - static VersionedProtocol waitForProxy(Class protocol, + static VersionedProtocol waitForProxy( + Class protocol, long clientVersion, InetSocketAddress addr, Configuration conf, @@ -334,7 +339,8 @@ public class RPC { } /** Construct a client-side proxy object that implements the named protocol, * talking to a server at the named address. */ - public static VersionedProtocol getProxy(Class protocol, + public static VersionedProtocol getProxy( + Class protocol, long clientVersion, InetSocketAddress addr, Configuration conf, SocketFactory factory) throws IOException { UserGroupInformation ugi = null; @@ -348,14 +354,15 @@ public class RPC { /** Construct a client-side proxy object that implements the named protocol, * talking to a server at the named address. */ - public static VersionedProtocol getProxy(Class protocol, + public static VersionedProtocol getProxy( + Class protocol, long clientVersion, InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, SocketFactory factory) throws IOException { VersionedProtocol proxy = (VersionedProtocol) Proxy.newProxyInstance( protocol.getClassLoader(), new Class[] { protocol }, - new Invoker(addr, ticket, conf, factory)); + new Invoker(protocol, addr, ticket, conf, factory)); long serverVersion = proxy.getProtocolVersion(protocol.getName(), clientVersion); if (serverVersion == clientVersion) { @@ -376,7 +383,8 @@ public class RPC { * @return a proxy instance * @throws IOException */ - public static VersionedProtocol getProxy(Class protocol, + public static VersionedProtocol getProxy( + Class protocol, long clientVersion, InetSocketAddress addr, Configuration conf) throws IOException {