hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang...@apache.org
Subject hbase git commit: HBASE-15664 Use Long.MAX_VALUE instead of HConstants.FOREVER in CompactionPolicy
Date Mon, 18 Apr 2016 12:12:01 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 7dacf9f10 -> ee78b6da7


HBASE-15664 Use Long.MAX_VALUE instead of HConstants.FOREVER in CompactionPolicy


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

Branch: refs/heads/branch-1
Commit: ee78b6da7aade033e529d6e6e3a8214eb01d791f
Parents: 7dacf9f
Author: zhangduo <zhangduo@apache.org>
Authored: Mon Apr 18 11:46:34 2016 +0800
Committer: zhangduo <zhangduo@apache.org>
Committed: Mon Apr 18 20:11:35 2016 +0800

----------------------------------------------------------------------
 .../regionserver/compactions/DateTieredCompactionPolicy.java    | 5 ++---
 .../regionserver/compactions/RatioBasedCompactionPolicy.java    | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ee78b6da/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 d61af42..6527c9b 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
@@ -36,7 +36,6 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseInterfaceAudience;
-import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HDFSBlocksDistribution;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.regionserver.RSRpcServices;
@@ -118,8 +117,8 @@ public class DateTieredCompactionPolicy extends SortedCompactionPolicy
{
 
     for (StoreFile file: filesToCompact) {
       Long minTimestamp = file.getMinimumTimestamp();
-      long oldest = (minTimestamp == null) ? (Long)Long.MIN_VALUE : now - minTimestamp.longValue();
-      if (cfTTL != HConstants.FOREVER && oldest >= cfTTL) {
+      long oldest = (minTimestamp == null) ? Long.MIN_VALUE : now - minTimestamp.longValue();
+      if (cfTTL != Long.MAX_VALUE && oldest >= cfTTL) {
         LOG.debug("Major compaction triggered on store " + this
           + "; for TTL maintenance");
         return true;

http://git-wip-us.apache.org/repos/asf/hbase/blob/ee78b6da/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/RatioBasedCompactionPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/RatioBasedCompactionPolicy.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/RatioBasedCompactionPolicy.java
index c95911a..7b812cd 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/RatioBasedCompactionPolicy.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/RatioBasedCompactionPolicy.java
@@ -70,7 +70,7 @@ public class RatioBasedCompactionPolicy extends SortedCompactionPolicy {
         StoreFile sf = filesToCompact.iterator().next();
         Long minTimestamp = sf.getMinimumTimestamp();
         long oldest = (minTimestamp == null) ? Long.MIN_VALUE : now - minTimestamp.longValue();
-        if (sf.isMajorCompaction() && (cfTTL == HConstants.FOREVER || oldest <
cfTTL)) {
+        if (sf.isMajorCompaction() && (cfTTL == Long.MAX_VALUE || oldest < cfTTL))
{
           float blockLocalityIndex =
             sf.getHDFSBlockDistribution().getBlockLocalityIndex(
             RSRpcServices.getHostname(comConf.conf, false));


Mime
View raw message