hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1240447 - in /hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs: CHANGES.HDFS-1623.txt src/main/java/org/apache/hadoop/hdfs/DFSUtil.java
Date Sat, 04 Feb 2012 03:00:18 GMT
Author: atm
Date: Sat Feb  4 03:00:17 2012
New Revision: 1240447

URL: http://svn.apache.org/viewvc?rev=1240447&view=rev
Log:
HDFS-2890. DFSUtil#getSuffixIDs should skip unset configurations. Contributed by Aaron T.
Myers.

Modified:
    hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
    hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java

Modified: hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt?rev=1240447&r1=1240446&r2=1240447&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
Sat Feb  4 03:00:17 2012
@@ -162,3 +162,5 @@ marked required. (atm via eli)
 HDFS-2863. Failures observed if dfs.edits.dir and shared.edits.dir have same directories.
(Bikas Saha via atm)
 
 HDFS-2874. Edit log should log to shared dirs before local dirs. (todd)
+
+HDFS-2890. DFSUtil#getSuffixIDs should skip unset configurations. (atm)

Modified: hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java?rev=1240447&r1=1240446&r2=1240447&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java
Sat Feb  4 03:00:17 2012
@@ -655,7 +655,6 @@ public class DFSUtil {
    */
   public static String getInfoServer(
       InetSocketAddress namenodeAddr, Configuration conf, boolean httpsAddress) {
-    String httpAddress = null;
     boolean securityOn = UserGroupInformation.isSecurityEnabled();
     String httpAddressKey = (securityOn && httpsAddress) ? 
         DFS_NAMENODE_HTTPS_ADDRESS_KEY : DFS_NAMENODE_HTTP_ADDRESS_KEY;
@@ -957,16 +956,23 @@ public class DFSUtil {
       
       Collection<String> nnIds = getNameNodeIds(conf, nsId);
       for (String nnId : emptyAsSingletonNull(nnIds)) {
+        if (LOG.isTraceEnabled()) {
+          LOG.trace(String.format("addressKey: %s nsId: %s nnId: %s",
+              addressKey, nsId, nnId));
+        }
         if (knownNNId != null && !knownNNId.equals(nnId)) {
           continue;
         }
         String key = addKeySuffixes(addressKey, nsId, nnId);
         String addr = conf.get(key);
+        if (addr == null) {
+          continue;
+        }
         InetSocketAddress s = null;
         try {
           s = NetUtils.createSocketAddr(addr);
         } catch (Exception e) {
-          LOG.warn("Exception in creating socket address", e);
+          LOG.warn("Exception in creating socket address " + addr, e);
           continue;
         }
         if (!s.isUnresolved() && matcher.match(s)) {



Mime
View raw message