hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject hbase git commit: HBASE-18015 Storage class aware block placement for procedure v2 WALs
Date Mon, 08 May 2017 21:18:09 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 0d0ccc38f -> 3dc38a4ff


HBASE-18015 Storage class aware block placement for procedure v2 WALs


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

Branch: refs/heads/master
Commit: 3dc38a4ff1210e662f3d08fe768def9b79f008e9
Parents: 0d0ccc3
Author: Andrew Purtell <apurtell@apache.org>
Authored: Fri May 5 16:42:57 2017 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Mon May 8 14:11:27 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/master/HMaster.java | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/3dc38a4f/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index e4ba285..762dda0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -49,6 +49,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.ClusterStatus;
 import org.apache.hadoop.hbase.CoordinatedStateException;
@@ -1139,7 +1140,19 @@ public class HMaster extends HRegionServer implements MasterServices
{
     final Path walDir = new Path(FSUtils.getWALRootDir(this.conf),
         MasterProcedureConstants.MASTER_PROCEDURE_LOGDIR);
 
-    procedureStore = new WALProcedureStore(conf, walDir.getFileSystem(conf), walDir,
+    final FileSystem walFs = walDir.getFileSystem(conf);
+
+    // Create the log directory for the procedure store
+    if (!walFs.exists(walDir)) {
+      if (!walFs.mkdirs(walDir)) {
+        throw new IOException("Unable to mkdir " + walDir);
+      }
+    }
+    // Now that it exists, set the log policy
+    FSUtils.setStoragePolicy(walFs, conf, walDir, HConstants.WAL_STORAGE_POLICY,
+      HConstants.DEFAULT_WAL_STORAGE_POLICY);
+
+    procedureStore = new WALProcedureStore(conf, walFs, walDir,
         new MasterProcedureEnv.WALStoreLeaseRecovery(this));
     procedureStore.registerListener(new MasterProcedureEnv.MasterProcedureStoreListener(this));
     MasterProcedureScheduler procedureScheduler = procEnv.getProcedureScheduler();


Mime
View raw message