hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia7...@apache.org
Subject hbase git commit: HBASE-18938 Backport HBASE-16985(TestClusterId failed due to wrong hbase rootdir) to branch-1.3
Date Sun, 19 Nov 2017 04:26:58 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 c9f6aa3b1 -> 48e6ad440


HBASE-18938 Backport HBASE-16985(TestClusterId failed due to wrong hbase rootdir) to branch-1.3

Signed-off-by: Chia-Ping Tsai <chia7712@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/48e6ad44
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/48e6ad44
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/48e6ad44

Branch: refs/heads/branch-1.3
Commit: 48e6ad4404f9f47f9b952e7e2d434ff7ecf14aa3
Parents: c9f6aa3
Author: Ashish Singhi <ashishsinghi@apache.org>
Authored: Thu Oct 5 12:51:39 2017 +0530
Committer: Chia-Ping Tsai <chia7712@gmail.com>
Committed: Sun Nov 19 12:25:05 2017 +0800

----------------------------------------------------------------------
 .../hbase/regionserver/HRegionServer.java       | 28 ++++++++++++--------
 1 file changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/48e6ad44/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index 54934f3..5959871 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -578,17 +578,7 @@ public class HRegionServer extends HasThread implements
 
     useZKForAssignment = ConfigUtil.useZKForAssignment(conf);
 
-    // Set 'fs.defaultFS' to match the filesystem on hbase.rootdir else
-    // underlying hadoop hdfs accessors will be going against wrong filesystem
-    // (unless all is set to defaults).
-    FSUtils.setFsDefault(this.conf, FSUtils.getRootDir(this.conf));
-    // Get fs instance used by this RS.  Do we use checksum verification in the hbase? If
hbase
-    // checksum verification enabled, then automatically switch off hdfs checksum verification.
-    boolean useHBaseChecksum = conf.getBoolean(HConstants.HBASE_CHECKSUM_VERIFICATION, true);
-    this.fs = new HFileSystem(this.conf, useHBaseChecksum);
-    this.rootDir = FSUtils.getRootDir(this.conf);
-    this.tableDescriptors = new FSTableDescriptors(
-      this.conf, this.fs, this.rootDir, !canUpdateTableDescriptor(), false);
+    initializeFileSystem();
 
     service = new ExecutorService(getServerName().toShortString());
     spanReceiverHost = SpanReceiverHost.getInstance(getConfiguration());
@@ -641,6 +631,20 @@ public class HRegionServer extends HasThread implements
     choreService.scheduleChore(compactedFileDischarger);
   }
 
+  private void initializeFileSystem() throws IOException {
+    // Set 'fs.defaultFS' to match the filesystem on hbase.rootdir else
+    // underlying hadoop hdfs accessors will be going against wrong filesystem
+    // (unless all is set to defaults).
+    FSUtils.setFsDefault(this.conf, FSUtils.getRootDir(this.conf));
+    // Get fs instance used by this RS. Do we use checksum verification in the hbase? If
hbase
+    // checksum verification enabled, then automatically switch off hdfs checksum verification.
+    boolean useHBaseChecksum = this.conf.getBoolean(HConstants.HBASE_CHECKSUM_VERIFICATION,
true);
+    this.fs = new HFileSystem(this.conf, useHBaseChecksum);
+    this.rootDir = FSUtils.getRootDir(this.conf);
+    this.tableDescriptors = new FSTableDescriptors(
+      this.conf, this.fs, this.rootDir, !canUpdateTableDescriptor(), false);
+  }
+
   protected void setInitLatch(CountDownLatch latch) {
     this.initLatch = latch;
   }
@@ -1402,6 +1406,8 @@ public class HRegionServer extends HasThread implements
         }
         this.conf.set(key, value);
       }
+      // initialize file system again by the config fs.defaultFS and hbase.rootdir from master
+      initializeFileSystem();
 
       // hack! Maps DFSClient => RegionServer for logs.  HDFS made this
       // config param for task trackers, but we can piggyback off of it.


Mime
View raw message