virajjasani commented on a change in pull request #931: HBASE-22285 A normalizer which merges small size regions with adjacen… URL: https://github.com/apache/hbase/pull/931#discussion_r357675978
########## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/MergeNormalizer.java ########## @@ -0,0 +1,154 @@ +package org.apache.hadoop.hbase.master.normalizer; + +import com.google.protobuf.ServiceException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hbase.HBaseIOException; +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.RegionLoad; +import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.client.Admin; +import org.apache.hadoop.hbase.master.MasterRpcServices; +import org.apache.hadoop.hbase.master.MasterServices; +import org.apache.hadoop.hbase.protobuf.RequestConverter; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + + + +/** + * Implementation of MergeNormalizer + * + * Logic in use: + * + * <ol> + * <li> get all regions of a given table + * <li> get avg size S of each region (by total size of store files reported in RegionLoad) + * <li> Otherwise, two region R1 and its smallest neighbor R2 are merged, + * if R1 + R1 < S, and all such regions are returned to be merged Review comment: nit: `R1 + R2 < S` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
