hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [32/50] [abbrv] hbase git commit: Add an exists
Date Tue, 23 May 2017 07:36:44 GMT
Add an exists


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

Branch: refs/heads/HBASE-14614
Commit: c443308486d624a3f7ac086cf6ad1a30f6a94064
Parents: a8dfa37
Author: Michael Stack <stack@apache.org>
Authored: Fri May 12 15:43:23 2017 -0700
Committer: Michael Stack <stack@apache.org>
Committed: Tue May 23 00:33:03 2017 -0700

----------------------------------------------------------------------
 .../hbase/procedure2/store/wal/ProcedureWALFile.java    |  2 +-
 .../hbase/procedure2/store/wal/WALProcedureStore.java   | 12 +++++++++++-
 .../java/org/apache/hadoop/hbase/master/HMaster.java    |  4 ++--
 3 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c4433084/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFile.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFile.java
b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFile.java
index 42abe8f..95a1ef6 100644
--- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFile.java
+++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFile.java
@@ -160,7 +160,7 @@ public class ProcedureWALFile implements Comparable<ProcedureWALFile>
{
     boolean archived = false;
     if (walArchiveDir != null) {
       Path archivedFile = new Path(walArchiveDir, logFile.getName());
-      LOG.info("ARCHIVED (TODO: FILES ARE NOT PURGED FROM ARCHIVE!) " + logFile + " to "
+ walArchiveDir);
+      LOG.info("ARCHIVED (TODO: FILES ARE NOT PURGED FROM ARCHIVE!) " + logFile + " to "
+ archivedFile);
       if (!fs.rename(logFile, archivedFile)) {
         LOG.warn("Failed archive of " + logFile + ", deleting");
       } else {

http://git-wip-us.apache.org/repos/asf/hbase/blob/c4433084/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
index df818fe..b64fd54 100644
--- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
+++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
@@ -246,6 +246,16 @@ public class WALProcedureStore extends ProcedureStoreBase {
       }
     };
     syncThread.start();
+
+    // Create archive dir up front. Rename won't work w/o it up on HDFS.
+    if (this.walArchiveDir != null && !this.fs.exists(this.walArchiveDir)) {
+      if (this.fs.mkdirs(this.walArchiveDir)) {
+        if (LOG.isDebugEnabled()) LOG.debug("Created Procedure Store WAL archive dir " +
+            this.walArchiveDir);
+      } else {
+        LOG.warn("Failed create of " + this.walArchiveDir);
+      }
+    }
   }
 
   @Override
@@ -1113,7 +1123,7 @@ public class WALProcedureStore extends ProcedureStoreBase {
       log.removeFile(walArchiveDir);
       logs.remove(log);
       if (LOG.isDebugEnabled()) {
-        LOG.info("Removed log=" + log + " activeLogs=" + logs);
+        LOG.info("Removed log=" + log + ", activeLogs=" + logs);
       }
       assert logs.size() > 0 : "expected at least one log";
     } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/c4433084/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 6796d59..39e1e6e 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
@@ -1163,7 +1163,7 @@ public class HMaster extends HRegionServer implements MasterServices
{
     final MasterProcedureEnv procEnv = new MasterProcedureEnv(this);
     final Path walDir = new Path(FSUtils.getWALRootDir(this.conf),
         MasterProcedureConstants.MASTER_PROCEDURE_LOGDIR);
-    final Path archiveWalDir = new Path(new Path(FSUtils.getWALRootDir(this.conf),
+    final Path walArchiveDir = new Path(new Path(FSUtils.getWALRootDir(this.conf),
         HConstants.HFILE_ARCHIVE_DIRECTORY), MasterProcedureConstants.MASTER_PROCEDURE_LOGDIR);
 
     final FileSystem walFs = walDir.getFileSystem(conf);
@@ -1178,7 +1178,7 @@ public class HMaster extends HRegionServer implements MasterServices
{
     FSUtils.setStoragePolicy(walFs, conf, walDir, HConstants.WAL_STORAGE_POLICY,
       HConstants.DEFAULT_WAL_STORAGE_POLICY);
 
-    procedureStore = new WALProcedureStore(conf, walDir.getFileSystem(conf), walDir, archiveWalDir,
+    procedureStore = new WALProcedureStore(conf, walDir.getFileSystem(conf), walDir, walArchiveDir,
         new MasterProcedureEnv.WALStoreLeaseRecovery(this));
     procedureStore.registerListener(new MasterProcedureEnv.MasterProcedureStoreListener(this));
     MasterProcedureScheduler procedureScheduler = procEnv.getProcedureScheduler();


Mime
View raw message