hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-15181 Addendum fixes findbugs warning (Clara Xiong)
Date Wed, 02 Mar 2016 02:32:07 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 72169b4a8 -> 41c04ee68


HBASE-15181 Addendum fixes findbugs warning (Clara Xiong)


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

Branch: refs/heads/0.98
Commit: 41c04ee685b07321efe570fa91416ba90f8eeaa9
Parents: 72169b4
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue Mar 1 18:31:59 2016 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue Mar 1 18:31:59 2016 -0800

----------------------------------------------------------------------
 .../compactions/DateTieredCompactionPolicy.java      | 15 ++++++++++-----
 .../hbase/regionserver/TestCompactionPolicy.java     |  4 ++--
 2 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/41c04ee6/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DateTieredCompactionPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DateTieredCompactionPolicy.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DateTieredCompactionPolicy.java
index b0c7c26..ba72658 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DateTieredCompactionPolicy.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DateTieredCompactionPolicy.java
@@ -117,9 +117,6 @@ public class DateTieredCompactionPolicy extends RatioBasedCompactionPolicy
{
   @VisibleForTesting
   public ArrayList<StoreFile> applyCompactionPolicy(ArrayList<StoreFile> candidates,
       boolean mayUseOffPeak, boolean mayBeStuck, long now) throws IOException {
-    // This might throw late arriving data out and create a sequence id gap?
-    // How can we filter bulk load file without this problem?
-    // For bulk load seq id[, what if we use creation time?
     Iterable<StoreFile> candidatesInWindow =
       filterOldStoreFiles(Lists.newArrayList(candidates), comConf.getMaxStoreFileAgeMillis(),
now);
 
@@ -127,7 +124,14 @@ public class DateTieredCompactionPolicy extends RatioBasedCompactionPolicy
{
         partitionFilesToBuckets(candidatesInWindow, comConf.getBaseWindowMillis(),
           comConf.getWindowsPerTier(), now);
     LOG.debug("Compaction buckets are: " + buckets);
-
+    if (buckets.size() >= storeConfigInfo.getBlockingFileCount()) {
+      LOG.warn("Number of compaction buckets:" +  buckets.size()
+        + ", exceeds blocking file count setting: "
+        + storeConfigInfo.getBlockingFileCount()
+        + ", either increase hbase.hstore.blockingStoreFiles or "
+        + "reduce the number of tiered compaction windows");
+    }
+    
     return newestBucket(buckets, comConf.getIncomingWindowMin(), now, comConf.getBaseWindowMillis(),
       mayUseOffPeak);
   }
@@ -221,8 +225,9 @@ public class DateTieredCompactionPolicy extends RatioBasedCompactionPolicy
{
     return Iterables.filter(storeFiles, new Predicate<StoreFile>() {
       @Override
       public boolean apply(StoreFile storeFile) {
+        // This is for findbugs' issue with Guava. We know this won't happen.
         if (storeFile == null) {
-          throw new NullPointerException();
+          return false;
         }
         return storeFile.getMaximumTimestamp() >= cutoff;
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/41c04ee6/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionPolicy.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionPolicy.java
index 436a7ed..902457f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionPolicy.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionPolicy.java
@@ -52,13 +52,13 @@ import com.google.common.collect.Lists;
 @Category(SmallTests.class)
 public class TestCompactionPolicy
 {
-    private final static Log LOG = LogFactory.getLog(TestDefaultCompactSelection.class);
+    private final static Log LOG = LogFactory.getLog(TestCompactionPolicy.class);
     protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
 
     protected Configuration conf;
     protected HStore store;
     private static final String DIR=
-      TEST_UTIL.getDataTestDir(TestDefaultCompactSelection.class.getSimpleName()).toString();
+      TEST_UTIL.getDataTestDir(TestCompactionPolicy.class.getSimpleName()).toString();
     protected static Path TEST_FILE;
 
     protected static final int minFiles = 3;


Mime
View raw message