Index: src/main/java/org/apache/hadoop/hbase/regionserver/IncreasingToUpperBoundRegionSplitPolicy.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/regionserver/IncreasingToUpperBoundRegionSplitPolicy.java (revision 1568198) +++ src/main/java/org/apache/hadoop/hbase/regionserver/IncreasingToUpperBoundRegionSplitPolicy.java (working copy) @@ -29,12 +29,12 @@ /** * Split size is the number of regions that are on this server that all are - * of the same table, squared, times the region flush size OR the maximum + * of the same table, squared, times 2x the region flush size OR the maximum * region split size, whichever is smaller. For example, if the flush size - * is 128M, then on first flush we will split which will make two regions - * that will split when their size is 2 * 2 * 128M = 512M. If one of these + * is 128M, then after two flushes we will split which will make two regions + * that will split when their size is 2 * 2 * 128M*2 = 1024M. If one of these * regions splits, then there are three regions and now the split size is - * 3 * 3 * 128M = 1152M, and so on until we reach the configured + * 3 * 3 * 128M*2 = 2304M, and so on until we reach the configured * maximum filesize and then from there on out, we'll use that. */ public class IncreasingToUpperBoundRegionSplitPolicy @@ -41,18 +41,22 @@ extends ConstantSizeRegionSplitPolicy { static final Log LOG = LogFactory.getLog(IncreasingToUpperBoundRegionSplitPolicy.class); - private long flushSize; + private long initialSize; @Override protected void configureForRegion(HRegion region) { super.configureForRegion(region); Configuration conf = getConf(); + this.initialSize = conf.getLong("hbase.increasing.policy.initial.size", -1); + if (this.initialSize > 0) { + return; + } HTableDescriptor desc = region.getTableDesc(); if (desc != null) { - this.flushSize = desc.getMemStoreFlushSize(); + this.initialSize = 2*desc.getMemStoreFlushSize(); } - if (this.flushSize <= 0) { - this.flushSize = conf.getLong(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, + if (this.initialSize <= 0) { + this.initialSize = 2*conf.getLong(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, HTableDescriptor.DEFAULT_MEMSTORE_FLUSH_SIZE); } } @@ -93,7 +97,7 @@ long getSizeToCheck(final int tableRegionsCount) { return tableRegionsCount == 0? getDesiredMaxFileSize(): Math.min(getDesiredMaxFileSize(), - this.flushSize * (tableRegionsCount * tableRegionsCount)); + this.initialSize * (tableRegionsCount * tableRegionsCount)); } /**