From 302c9e0ef81bbc454e1fdc8795bfd827e4bf25f4 Mon Sep 17 00:00:00 2001 From: Tsz-wo Sze Date: Sat, 7 Jan 2012 18:24:25 +0000 Subject: [PATCH] svn merge -c 1171711 from trunk for HDFS-2337. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23-PB@1228694 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../main/java/org/apache/hadoop/hdfs/DFSClient.java | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index b78cb2717d1..ff3de54fda9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -11,6 +11,8 @@ Release 0.23-PB - Unreleased HDFS-2351 Change Namenode and Datanode to register each of their protocols seperately (Sanjay Radia) + HDFS-2337. DFSClient shouldn't keep multiple RPC proxy references (atm) + Release 0.23.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java index 19d696ac457..f242cc83f65 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java @@ -123,7 +123,6 @@ public class DFSClient implements java.io.Closeable { public static final long SERVER_DEFAULTS_VALIDITY_PERIOD = 60 * 60 * 1000L; // 1 hour static final int TCP_WINDOW_SIZE = 128 * 1024; // 128 KB final ClientProtocol namenode; - final ClientProtocol rpcNamenode; private final InetSocketAddress nnAddress; final UserGroupInformation ugi; volatile boolean clientRunning = true; @@ -291,11 +290,10 @@ public DFSClient(InetSocketAddress nameNodeAddr, Configuration conf, this.clientName = leaserenewer.getClientName(dfsClientConf.taskId); this.socketCache = new SocketCache(dfsClientConf.socketCacheCapacity); if (nameNodeAddr != null && rpcNamenode == null) { - this.rpcNamenode = DFSUtil.createRPCNamenode(nameNodeAddr, conf, ugi); - this.namenode = DFSUtil.createNamenode(this.rpcNamenode); + this.namenode = DFSUtil.createNamenode(nameNodeAddr, conf); } else if (nameNodeAddr == null && rpcNamenode != null) { //This case is used for testing. - this.namenode = this.rpcNamenode = rpcNamenode; + this.namenode = rpcNamenode; } else { throw new IllegalArgumentException( "Expecting exactly one of nameNodeAddr and rpcNamenode being null: " @@ -385,7 +383,7 @@ void renewLease() throws IOException { void abort() { clientRunning = false; closeAllFilesBeingWritten(true); - RPC.stopProxy(rpcNamenode); // close connections to the namenode + RPC.stopProxy(namenode); // close connections to the namenode } /** Close/abort all files being written. */ @@ -425,7 +423,7 @@ public synchronized void close() throws IOException { clientRunning = false; leaserenewer.closeClient(this); // close connections to the namenode - RPC.stopProxy(rpcNamenode); + RPC.stopProxy(namenode); } }