You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2011/03/10 23:12:35 UTC

svn commit: r1080372 - in /hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase: master/MasterFileSystem.java util/FSUtils.java

Author: apurtell
Date: Thu Mar 10 22:12:35 2011
New Revision: 1080372

URL: http://svn.apache.org/viewvc?rev=1080372&view=rev
Log:
HBASE-1960  Master should wait for DFS to come up when creating hbase.version; catch another corner case

Modified:
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java?rev=1080372&r1=1080371&r2=1080372&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java Thu Mar 10 22:12:35 2011
@@ -241,7 +241,9 @@ public class MasterFileSystem {
       FSUtils.setVersion(fs, rd, c.getInt(HConstants.THREAD_WAKE_FREQUENCY,
         10 * 1000));
     } else {
-      FSUtils.checkVersion(fs, rd, true);
+      // as above
+      FSUtils.checkVersion(fs, rd, true, c.getInt(HConstants.THREAD_WAKE_FREQUENCY,
+        10 * 1000));
     }
     // Make sure the root region directory exists!
     if (!FSUtils.rootRegionExists(fs, rd)) {

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=1080372&r1=1080371&r2=1080372&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 Thu Mar 10 22:12:35 2011
@@ -175,13 +175,28 @@ public class FSUtils {
    */
   public static void checkVersion(FileSystem fs, Path rootdir,
       boolean message) throws IOException {
+    checkVersion(fs, rootdir, message, 0);
+  }
+
+  /**
+   * Verifies current version of file system
+   *
+   * @param fs file system
+   * @param rootdir root directory of HBase installation
+   * @param message if true, issues a message on System.out
+   * @param wait wait interval for retry if > 0
+   *
+   * @throws IOException e
+   */
+  public static void checkVersion(FileSystem fs, Path rootdir,
+      boolean message, int wait) throws IOException {
     String version = getVersion(fs, rootdir);
 
     if (version == null) {
       if (!rootRegionExists(fs, rootdir)) {
         // rootDir is empty (no version file and no root region)
         // just create new version file (HBASE-1195)
-        FSUtils.setVersion(fs, rootdir);
+        FSUtils.setVersion(fs, rootdir, wait);
         return;
       }
     } else if (version.compareTo(HConstants.FILE_SYSTEM_VERSION) == 0)