hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r713491 - /hadoop/hbase/branches/0.18/src/java/org/apache/hadoop/hbase/regionserver/HLog.java
Date Wed, 12 Nov 2008 20:17:27 GMT
Author: jimk
Date: Wed Nov 12 12:17:27 2008
New Revision: 713491

URL: http://svn.apache.org/viewvc?rev=713491&view=rev
Log:
HBASE-602   HBase Crash when network card has a IPv6 address
URL encode IPV6 address instead of just changing ':' to '.'

Modified:
    hadoop/hbase/branches/0.18/src/java/org/apache/hadoop/hbase/regionserver/HLog.java

Modified: hadoop/hbase/branches/0.18/src/java/org/apache/hadoop/hbase/regionserver/HLog.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.18/src/java/org/apache/hadoop/hbase/regionserver/HLog.java?rev=713491&r1=713490&r2=713491&view=diff
==============================================================================
--- hadoop/hbase/branches/0.18/src/java/org/apache/hadoop/hbase/regionserver/HLog.java (original)
+++ hadoop/hbase/branches/0.18/src/java/org/apache/hadoop/hbase/regionserver/HLog.java Wed
Nov 12 12:17:27 2008
@@ -22,6 +22,8 @@
 import java.io.EOFException;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
 import java.util.Collections;
 import java.util.Map;
 import java.util.SortedMap;
@@ -726,7 +728,13 @@
    */
   public static String getHLogDirectoryName(HServerInfo info) {
     StringBuilder dirName = new StringBuilder("log_");
-    dirName.append(info.getServerAddress().getBindAddress().replaceAll(":", "."));
+    try {
+      dirName.append(URLEncoder.encode(
+          info.getServerAddress().getBindAddress(), UTF8_ENCODING));
+    } catch (UnsupportedEncodingException e) {
+      LOG.error("Error encoding '" + info.getServerAddress().getBindAddress()
+          + "'", e);
+    }
     dirName.append("_");
     dirName.append(info.getStartCode());
     dirName.append("_");



Mime
View raw message