From f7f68d2106c9ca1ffc5c11a3cc0d14235aca389c Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Thu, 8 Mar 2012 00:25:43 +0000 Subject: [PATCH] HADOOP-8108. Merge r1293128 from trunk to 0.23 git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1298239 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 4 +++- .../src/main/java/org/apache/hadoop/net/NetUtils.java | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index e73a6a82197..75ddc345dba 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -58,7 +58,6 @@ Release 0.23.3 - UNRELEASED HADOOP-7621. alfredo config should be in a file not readable by users (Alejandro Abdelnur via atm) - HADOOP-8098. KerberosAuthenticatorHandler should use _HOST replacement to resolve principal name (tucu) @@ -77,6 +76,9 @@ Release 0.23.3 - UNRELEASED HADOOP-8141. Add method to SecurityUtil to init krb5 cipher suites. (todd) + HADOOP-8108. Move method getHostPortString() from NameNode to NetUtils. + (Brandon Li via jitendra) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java index f71c1894adc..0bfeaa7cfcd 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java @@ -606,6 +606,13 @@ public class NetUtils { catch(UnknownHostException uhe) {return "" + uhe;} } + /** + * Compose a "host:port" string from the address. + */ + public static String getHostPortString(InetSocketAddress addr) { + return addr.getHostName() + ":" + addr.getPort(); + } + /** * Checks if {@code host} is a local host name and return {@link InetAddress} * corresponding to that address.