hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [1/3] hbase git commit: HBASE-12454 Setting didPerformCompaction early in HRegion#compact
Date Wed, 12 Nov 2014 17:52:12 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 78c1a919c -> 28747bab8
  refs/heads/branch-1 f3a38dcf1 -> 16decdc19
  refs/heads/master fb6c5c7fe -> b0a434a5c


HBASE-12454 Setting didPerformCompaction early in HRegion#compact


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

Branch: refs/heads/0.98
Commit: 28747bab89d5a7050b9b26e1f6581c502d6d1864
Parents: 78c1a91
Author: Andrew Purtell <apurtell@apache.org>
Authored: Wed Nov 12 09:29:46 2014 -0800
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Wed Nov 12 09:41:38 2014 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/regionserver/HRegion.java | 2 +-
 .../main/java/org/apache/hadoop/hbase/regionserver/HStore.java  | 4 +++-
 .../org/apache/hadoop/hbase/regionserver/TestCompaction.java    | 5 ++++-
 3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/28747bab/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index 681dd3f..20b7b87 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -1479,8 +1479,8 @@ public class HRegion implements HeapSize { // , Writable{
         doRegionCompactionPrep();
         try {
           status.setStatus("Compacting store " + store);
-          didPerformCompaction = true;
           store.compact(compaction);
+          didPerformCompaction = true;
         } catch (InterruptedIOException iioe) {
           String msg = "compaction interrupted";
           LOG.info(msg, iioe);

http://git-wip-us.apache.org/repos/asf/hbase/blob/28747bab/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
index c6b62d4..55f1c35 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
@@ -1490,7 +1490,9 @@ public class HStore implements Store {
 
   @Override
   public void cancelRequestedCompaction(CompactionContext compaction) {
-    finishCompactionRequest(compaction.getRequest());
+    if (compaction != null) {
+      finishCompactionRequest(compaction.getRequest());
+    }
   }
 
   private void finishCompactionRequest(CompactionRequest cr) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/28747bab/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java
index 6e70b3e..ccc30f9 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java
@@ -159,7 +159,10 @@ public class TestCompaction {
         }
       }).when(spyR).doRegionCompactionPrep();
 
-      // force a minor compaction, but not before requesting a stop
+      // force a compaction, but not before requesting a stop
+
+      // Accounting: Normally compaction requests go through HStore#requestCompaction
+      r.reportCompactionRequestStart(true);
       spyR.compactStores();
 
       // ensure that the compaction stopped, all old files are intact,


Mime
View raw message