HBASE-15181 Addendum fixes findbugs warning (Clara Xiong)

This commit is contained in:
tedyu 2016-03-01 18:17:43 -08:00
parent 9ad13468a0
commit bab8d1527b
2 changed files with 10 additions and 3 deletions

View File

@ -135,6 +135,13 @@ 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);
@ -234,7 +241,7 @@ public class DateTieredCompactionPolicy extends RatioBasedCompactionPolicy {
public boolean apply(StoreFile storeFile) {
// Known findbugs issue to guava. SuppressWarning or Nonnull annotation don't work.
if (storeFile == null) {
throw new NullPointerException();
return false;
}
return storeFile.getMaximumTimestamp() >= cutoff;
}

View File

@ -50,13 +50,13 @@ import org.junit.experimental.categories.Category;
@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();
TestCompactionPolicy.class.getSimpleName()).toString();
protected static Path TEST_FILE;
protected static final int minFiles = 3;
protected static final int maxFiles = 5;