hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1095486 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
Date Wed, 20 Apr 2011 19:07:49 GMT
Author: apurtell
Date: Wed Apr 20 19:07:49 2011
New Revision: 1095486

URL: http://svn.apache.org/viewvc?rev=1095486&view=rev
Log:
HBASE-3800  HMaster is not able to start due to AlreadyCreatedException

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1095486&r1=1095485&r2=1095486&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Wed Apr 20 19:07:49 2011
@@ -25,6 +25,7 @@ Release 0.90.3 - Unreleased
    HBASE-3783  hbase-0.90.2.jar exists in hbase root and in 'lib/'
    HBASE-3781  hbase shell cannot start "NoMethodError: undefined method
                `close' for nil:NilClass" (Mikael Sitruk)
+   HBASE-3800  HMaster is not able to start due to AlreadyCreatedException
 
   IMPROVEMENT
    HBASE-3717  deprecate HTable isTableEnabled() methods in favor of HBaseAdmin

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java?rev=1095486&r1=1095485&r2=1095486&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java Wed Apr 20
19:07:49 2011
@@ -38,7 +38,6 @@ import org.apache.hadoop.hdfs.protocol.A
 import org.apache.hadoop.hdfs.protocol.FSConstants;
 import org.apache.hadoop.hdfs.server.namenode.LeaseExpiredException;
 import org.apache.hadoop.io.SequenceFile;
-import org.apache.hadoop.util.StringUtils;
 
 import java.io.DataInputStream;
 import java.io.EOFException;
@@ -250,26 +249,26 @@ public class FSUtils {
    */
   public static void setVersion(FileSystem fs, Path rootdir, String version,
       int wait) throws IOException {
-    while (true) try {
-      FSDataOutputStream s =
-        fs.create(new Path(rootdir, HConstants.VERSION_FILE_NAME));
-      s.writeUTF(version);
-      s.close();
-      LOG.debug("Created version file at " + rootdir.toString() +
-        " set its version at:" + version);
-      return;
-    } catch (IOException e) {
-      if (wait > 0) {
-        LOG.warn("Unable to create version file at " + rootdir.toString() +
-          ", retrying: " + StringUtils.stringifyException(e));
-        try {
-          Thread.sleep(wait);
-        } catch (InterruptedException ex) {
-          // ignore
+    Path versionFile = new Path(rootdir, HConstants.VERSION_FILE_NAME);
+    while (true) {
+      try {
+        FSDataOutputStream s = fs.create(versionFile);
+        s.writeUTF(version);
+        LOG.debug("Created version file at " + rootdir.toString() +
+            " set its version at:" + version);
+        s.close();
+        return;
+      } catch (IOException e) {
+        if (wait > 0) {
+          LOG.warn("Unable to create version file at " + rootdir.toString() +
+              ", retrying: " + e.getMessage());
+          fs.delete(versionFile, false);
+          try {
+            Thread.sleep(wait);
+          } catch (InterruptedException ex) {
+            // ignore
+          }
         }
-      } else {
-        // rethrow
-        throw e;
       }
     }
   }



Mime
View raw message