From 21932c59813e409653a4014af4b17acdcf03b9b5 Mon Sep 17 00:00:00 2001 From: Jim Kellerman Date: Thu, 14 Feb 2008 18:49:00 +0000 Subject: [PATCH] HBASE-446 Fully qualified hbase.rootdir doesn't work git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@627837 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + src/java/org/apache/hadoop/hbase/HRegionServer.java | 6 ++++++ src/java/org/apache/hadoop/hbase/master/HMaster.java | 6 ++++-- src/java/overview.html | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index f47825d349d..272ffe8b73c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -19,6 +19,7 @@ Hbase Change Log HBASE-426 hbase can't find remote filesystem HBASE-437 Clear Command should use system.out (Edward Yoon via Stack) HBASE-434, HBASE-435 TestTableIndex and TestTableMapReduce failed in Hudson builds + HBASE-446 Fully qualified hbase.rootdir doesn't work IMPROVEMENTS HBASE-415 Rewrite leases to use DelayedBlockingQueue instead of polling diff --git a/src/java/org/apache/hadoop/hbase/HRegionServer.java b/src/java/org/apache/hadoop/hbase/HRegionServer.java index 57cd8767d8d..c731999c389 100644 --- a/src/java/org/apache/hadoop/hbase/HRegionServer.java +++ b/src/java/org/apache/hadoop/hbase/HRegionServer.java @@ -872,6 +872,12 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { } this.conf.set(key, value); } + // Master sent us hbase.rootdir to use. Should be fully qualified + // path with file system specification included. Set 'fs.default.name' + // to match the filesystem on hbase.rootdir else underlying hadoop hdfs + // accessors will be going against wrong filesystem (unless all is set + // to defaults). + this.conf.set("fs.default.name", this.conf.get("hbase.rootdir")); this.fs = FileSystem.get(this.conf); this.rootDir = new Path(this.conf.get(HConstants.HBASE_DIR)); this.log = setupHLog(); diff --git a/src/java/org/apache/hadoop/hbase/master/HMaster.java b/src/java/org/apache/hadoop/hbase/master/HMaster.java index af363b33318..844fe878e44 100644 --- a/src/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/src/java/org/apache/hadoop/hbase/master/HMaster.java @@ -255,10 +255,12 @@ public class HMaster extends Thread implements HConstants, HMasterInterface, */ public HMaster(Path rd, HServerAddress address, HBaseConfiguration conf) throws IOException { - this.conf = conf; + this.rootdir = rd; + // 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); - this.rootdir = this.fs.makeQualified(rd); this.conf.set(HConstants.HBASE_DIR, this.rootdir.toString()); this.rand = new Random(); Path rootRegionDir = diff --git a/src/java/overview.html b/src/java/overview.html index 494f6e52eba..7f59b8b66ee 100644 --- a/src/java/overview.html +++ b/src/java/overview.html @@ -75,7 +75,7 @@ example: <property> <name>hbase.master</name> - <value>http://localhost:60000</value> + <value>localhost:60000</value> <description>The host and port that the HBase master runs at. </description> </property>