HBASE-12870 "Major compaction triggered" and "Skipping major compaction" messages lack the region information
Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
parent
c0f265384f
commit
30d0c3fdde
|
@ -28,6 +28,7 @@ import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.HConstants;
|
import org.apache.hadoop.hbase.HConstants;
|
||||||
import org.apache.hadoop.hbase.classification.InterfaceAudience;
|
import org.apache.hadoop.hbase.classification.InterfaceAudience;
|
||||||
|
import org.apache.hadoop.hbase.regionserver.HStore;
|
||||||
import org.apache.hadoop.hbase.regionserver.RSRpcServices;
|
import org.apache.hadoop.hbase.regionserver.RSRpcServices;
|
||||||
import org.apache.hadoop.hbase.regionserver.StoreConfigInformation;
|
import org.apache.hadoop.hbase.regionserver.StoreConfigInformation;
|
||||||
import org.apache.hadoop.hbase.regionserver.StoreFile;
|
import org.apache.hadoop.hbase.regionserver.StoreFile;
|
||||||
|
@ -64,6 +65,12 @@ public class RatioBasedCompactionPolicy extends SortedCompactionPolicy {
|
||||||
long lowTimestamp = StoreUtils.getLowestTimestamp(filesToCompact);
|
long lowTimestamp = StoreUtils.getLowestTimestamp(filesToCompact);
|
||||||
long now = EnvironmentEdgeManager.currentTime();
|
long now = EnvironmentEdgeManager.currentTime();
|
||||||
if (lowTimestamp > 0L && lowTimestamp < (now - mcTime)) {
|
if (lowTimestamp > 0L && lowTimestamp < (now - mcTime)) {
|
||||||
|
String regionInfo;
|
||||||
|
if (this.storeConfigInfo != null && this.storeConfigInfo instanceof HStore) {
|
||||||
|
regionInfo = ((HStore)this.storeConfigInfo).getRegionInfo().getRegionNameAsString();
|
||||||
|
} else {
|
||||||
|
regionInfo = this.toString();
|
||||||
|
}
|
||||||
// Major compaction time has elapsed.
|
// Major compaction time has elapsed.
|
||||||
long cfTTL = this.storeConfigInfo.getStoreFileTtl();
|
long cfTTL = this.storeConfigInfo.getStoreFileTtl();
|
||||||
if (filesToCompact.size() == 1) {
|
if (filesToCompact.size() == 1) {
|
||||||
|
@ -76,24 +83,24 @@ public class RatioBasedCompactionPolicy extends SortedCompactionPolicy {
|
||||||
sf.getHDFSBlockDistribution().getBlockLocalityIndex(
|
sf.getHDFSBlockDistribution().getBlockLocalityIndex(
|
||||||
RSRpcServices.getHostname(comConf.conf, false));
|
RSRpcServices.getHostname(comConf.conf, false));
|
||||||
if (blockLocalityIndex < comConf.getMinLocalityToForceCompact()) {
|
if (blockLocalityIndex < comConf.getMinLocalityToForceCompact()) {
|
||||||
LOG.debug("Major compaction triggered on only store " + this
|
LOG.debug("Major compaction triggered on only store " + regionInfo
|
||||||
+ "; to make hdfs blocks local, current blockLocalityIndex is "
|
+ "; to make hdfs blocks local, current blockLocalityIndex is "
|
||||||
+ blockLocalityIndex + " (min " + comConf.getMinLocalityToForceCompact() + ")");
|
+ blockLocalityIndex + " (min " + comConf.getMinLocalityToForceCompact() + ")");
|
||||||
result = true;
|
result = true;
|
||||||
} else {
|
} else {
|
||||||
LOG.debug("Skipping major compaction of " + this
|
LOG.debug("Skipping major compaction of " + regionInfo
|
||||||
+ " because one (major) compacted file only, oldestTime " + oldest
|
+ " because one (major) compacted file only, oldestTime " + oldest
|
||||||
+ "ms is < TTL=" + cfTTL + " and blockLocalityIndex is " + blockLocalityIndex
|
+ "ms is < TTL=" + cfTTL + " and blockLocalityIndex is " + blockLocalityIndex
|
||||||
+ " (min " + comConf.getMinLocalityToForceCompact() + ")");
|
+ " (min " + comConf.getMinLocalityToForceCompact() + ")");
|
||||||
}
|
}
|
||||||
} else if (cfTTL != HConstants.FOREVER && oldest > cfTTL) {
|
} else if (cfTTL != HConstants.FOREVER && oldest > cfTTL) {
|
||||||
LOG.debug("Major compaction triggered on store " + this
|
LOG.debug("Major compaction triggered on store " + regionInfo
|
||||||
+ ", because keyvalues outdated; time since last major compaction "
|
+ ", because keyvalues outdated; time since last major compaction "
|
||||||
+ (now - lowTimestamp) + "ms");
|
+ (now - lowTimestamp) + "ms");
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG.debug("Major compaction triggered on store " + this
|
LOG.debug("Major compaction triggered on store " + regionInfo
|
||||||
+ "; time since last major compaction " + (now - lowTimestamp) + "ms");
|
+ "; time since last major compaction " + (now - lowTimestamp) + "ms");
|
||||||
}
|
}
|
||||||
result = true;
|
result = true;
|
||||||
|
|
Loading…
Reference in New Issue