From a0b7fb537334512e2df13354b09f714493417dca Mon Sep 17 00:00:00 2001 From: sershe Date: Tue, 9 Apr 2013 22:20:44 +0000 Subject: [PATCH] HBASE-7791 Compaction USER_PRIORITY is slightly broken git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1466267 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop/hbase/regionserver/DefaultStoreFileManager.java | 3 ++- .../java/org/apache/hadoop/hbase/regionserver/HStore.java | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreFileManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreFileManager.java index 17afb16de83..a77f89fba2b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreFileManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreFileManager.java @@ -131,7 +131,8 @@ class DefaultStoreFileManager implements StoreFileManager { public int getStoreCompactionPriority() { int blockingFileCount = conf.getInt( HStore.BLOCKING_STOREFILES_KEY, HStore.DEFAULT_BLOCKING_STOREFILE_COUNT); - return blockingFileCount - storefiles.size(); + int priority = blockingFileCount - storefiles.size(); + return (priority == HStore.PRIORITY_USER) ? priority + 1 : priority; } private void sortAndSetStoreFiles(List storeFiles) { 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 690a616dc7c..0e0c32d142a 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 @@ -1659,7 +1659,11 @@ public class HStore implements Store { @Override public int getCompactPriority() { - return this.storeEngine.getStoreFileManager().getStoreCompactionPriority(); + int priority = this.storeEngine.getStoreFileManager().getStoreCompactionPriority(); + if (priority == PRIORITY_USER) { + LOG.warn("Compaction priority is USER despite there being no user compaction"); + } + return priority; } @Override