You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ji...@apache.org on 2008/03/21 22:24:32 UTC
svn commit: r639852 - in /hadoop/hbase/branches/0.1: CHANGES.txt
src/java/org/apache/hadoop/hbase/HMaster.java
Author: jimk
Date: Fri Mar 21 14:24:31 2008
New Revision: 639852
URL: http://svn.apache.org/viewvc?rev=639852&view=rev
Log:
HBASE-537 Wait for hdfs to exit safe mode
Modified:
hadoop/hbase/branches/0.1/CHANGES.txt
hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMaster.java
Modified: hadoop/hbase/branches/0.1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/CHANGES.txt?rev=639852&r1=639851&r2=639852&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.1/CHANGES.txt Fri Mar 21 14:24:31 2008
@@ -47,6 +47,7 @@
the top region of a split region
HBASE-524 Problems with getFull
HBASE-514 table 'does not exist' when it does
+ HBASE-537 Wait for hdfs to exit safe mode
IMPROVEMENTS
HADOOP-2555 Refactor the HTable#get and HTable#getRow methods to avoid
Modified: hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMaster.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMaster.java?rev=639852&r1=639851&r2=639852&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMaster.java (original)
+++ hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMaster.java Fri Mar 21 14:24:31 2008
@@ -46,6 +46,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.dfs.DistributedFileSystem;
+import org.apache.hadoop.dfs.FSConstants;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
@@ -876,10 +878,25 @@
throws IOException {
this.conf = conf;
this.rootdir = rd;
+ this.threadWakeFrequency = conf.getInt(THREAD_WAKE_FREQUENCY, 10 * 1000);
// The filesystem hbase wants to use is probably not what is set into
// fs.default.name; its value is probably the default.
this.conf.set("fs.default.name", this.rootdir.toString());
this.fs = FileSystem.get(conf);
+ if (this.fs instanceof DistributedFileSystem) {
+ // Make sure dfs is not in safe mode
+ String message = "Waiting for dfs to exit safe mode...";
+ while (((DistributedFileSystem) fs).setSafeMode(
+ FSConstants.SafeModeAction.SAFEMODE_GET)) {
+ System.out.println(message);
+ LOG.info(message);
+ try {
+ Thread.sleep(this.threadWakeFrequency);
+ } catch (InterruptedException e) {
+ //continue
+ }
+ }
+ }
this.conf.set(HConstants.HBASE_DIR, this.rootdir.toString());
this.rand = new Random();
Path rootRegionDir =
@@ -920,7 +937,6 @@
throw e;
}
- this.threadWakeFrequency = conf.getInt(THREAD_WAKE_FREQUENCY, 10 * 1000);
this.numRetries = conf.getInt("hbase.client.retries.number", 2);
this.maxRegionOpenTime =
conf.getLong("hbase.hbasemaster.maxregionopen", 60 * 1000);