From d089ac1ec6878c24799c1301ae649029c3a010dd Mon Sep 17 00:00:00 2001 From: stack Date: Thu, 3 Mar 2016 19:42:42 -0800 Subject: [PATCH] HBASE-15373 DEPRECATED_NAME_OF_NO_LIMIT_THROUGHPUT_CONTROLLER_CLASS value is wrong in CompactionThroughputControllerFactory --- .../org/apache/hadoop/hbase/regionserver/HStore.java | 9 ++++++--- .../hadoop/hbase/regionserver/RegionSplitPolicy.java | 1 + .../CompactionThroughputControllerFactory.java | 10 ++++------ 3 files changed, 11 insertions(+), 9 deletions(-) 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 d56c934d7e0..376ccfafa08 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 @@ -549,8 +549,8 @@ public class HStore implements Store { } if (ioe != null) { // close StoreFile readers - boolean evictOnClose = - cacheConf != null? cacheConf.shouldEvictOnClose(): true; + boolean evictOnClose = + cacheConf != null? cacheConf.shouldEvictOnClose(): true; for (StoreFile file : results) { try { if (file != null) file.closeReader(evictOnClose); @@ -846,7 +846,7 @@ public class HStore implements Store { completionService.submit(new Callable() { @Override public Void call() throws IOException { - boolean evictOnClose = + boolean evictOnClose = cacheConf != null? cacheConf.shouldEvictOnClose(): true; f.closeReader(evictOnClose); return null; @@ -2032,6 +2032,9 @@ public class HStore implements Store { assert !this.getRegionInfo().isMetaRegion(); // Not split-able if we find a reference store file present in the store. if (hasReferences()) { + if (LOG.isTraceEnabled()) { + LOG.trace("Not splittable; has references: " + this); + } return null; } return this.storeEngine.getStoreFileManager().getSplitPoint(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionSplitPolicy.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionSplitPolicy.java index 2ab2c8d7464..0e9b4ea3d13 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionSplitPolicy.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionSplitPolicy.java @@ -80,6 +80,7 @@ public abstract class RegionSplitPolicy extends Configured { long largestStoreSize = 0; for (Store s : stores) { byte[] splitPoint = s.getSplitPoint(); + // Store also returns null if it has references as way of indicating it is not splittable long storeSize = s.getSize(); if (splitPoint != null && largestStoreSize < storeSize) { splitPointFromLargestStore = splitPoint; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/CompactionThroughputControllerFactory.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/CompactionThroughputControllerFactory.java index 4b1bb00b474..d41dcea0a1f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/CompactionThroughputControllerFactory.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/CompactionThroughputControllerFactory.java @@ -41,11 +41,9 @@ public final class CompactionThroughputControllerFactory { // for backward compatibility and may not be supported in the future private static final String DEPRECATED_NAME_OF_PRESSURE_AWARE_THROUGHPUT_CONTROLLER_CLASS = - "org.apache.hadoop.hbase.regionserver.compactions." - + "PressureAwareCompactionThroughputController"; + "org.apache.hadoop.hbase.regionserver.compactions.PressureAwareCompactionThroughputController"; private static final String DEPRECATED_NAME_OF_NO_LIMIT_THROUGHPUT_CONTROLLER_CLASS = - "org.apache.hadoop.hbase.regionserver.compactions." - + "NoLimitThroughputController.java"; + "org.apache.hadoop.hbase.regionserver.compactions.NoLimitThroughputController"; public static ThroughputController create(RegionServerServices server, Configuration conf) { @@ -77,7 +75,7 @@ public final class CompactionThroughputControllerFactory { * @return the new name if there is any */ private static String resolveDeprecatedClassName(String oldName) { - String className = oldName; + String className = oldName.trim(); if (className.equals(DEPRECATED_NAME_OF_PRESSURE_AWARE_THROUGHPUT_CONTROLLER_CLASS)) { className = PressureAwareCompactionThroughputController.class.getName(); } else if (className.equals(DEPRECATED_NAME_OF_NO_LIMIT_THROUGHPUT_CONTROLLER_CLASS)) { @@ -88,4 +86,4 @@ public final class CompactionThroughputControllerFactory { } return className; } -} +} \ No newline at end of file