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 3dfabedd90e..037bc80425d 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 @@ -112,6 +112,9 @@ public class DateTieredCompactionPolicy extends SortedCompactionPolicy { throws IOException { long mcTime = getNextMajorCompactTime(filesToCompact); if (filesToCompact == null || mcTime == 0) { + if (LOG.isDebugEnabled()) { + LOG.debug("filesToCompact: " + filesToCompact + " mcTime: " + mcTime); + } return false; } @@ -119,6 +122,10 @@ public class DateTieredCompactionPolicy extends SortedCompactionPolicy { long lowTimestamp = StoreUtils.getLowestTimestamp(filesToCompact); long now = EnvironmentEdgeManager.currentTime(); if (lowTimestamp <= 0L || lowTimestamp >= (now - mcTime)) { + if (LOG.isDebugEnabled()) { + LOG.debug("lowTimestamp: " + lowTimestamp + " lowTimestamp: " + lowTimestamp + " now: " + + now + " mcTime: " + mcTime); + } return false; } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDateTieredCompactionPolicy.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDateTieredCompactionPolicy.java index e99eacb9931..eb52a846d42 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDateTieredCompactionPolicy.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDateTieredCompactionPolicy.java @@ -50,7 +50,7 @@ public class TestDateTieredCompactionPolicy extends AbstractTestDateTieredCompac this.conf.setFloat(CompactionConfiguration.HBASE_HSTORE_COMPACTION_RATIO_KEY, 1.2F); conf.setInt(HStore.BLOCKING_STOREFILES_KEY, 20); - conf.setLong(HConstants.MAJOR_COMPACTION_PERIOD, 10); + conf.setLong(HConstants.MAJOR_COMPACTION_PERIOD, 5); } /**