wchevreuil commented on a change in pull request #1883: URL: https://github.com/apache/hbase/pull/1883#discussion_r440853944
########## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SteppingAllStoresSizeSplitPolicy.java ########## @@ -0,0 +1,49 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.regionserver; + +import org.apache.hadoop.hbase.procedure2.util.StringUtils; +import org.apache.yetus.audience.InterfaceAudience; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + [email protected] +public class SteppingAllStoresSizeSplitPolicy extends SteppingSplitPolicy { + private static final Logger LOG = + LoggerFactory.getLogger(SteppingAllStoresSizeSplitPolicy.class); + + /** + * @return true if sum of store's size exceed the sizeToCheck + */ + @Override + protected boolean isExceedSize(int tableRegionsCount, long sizeToCheck) { + long sumSize = 0; + for (HStore store : region.getStores()) { + sumSize += store.getSize(); + } + if (sumSize > sizeToCheck) { + LOG.debug("ShouldSplit because region size is big enough " + + " size=" + StringUtils.humanSize(sumSize) + + ", sizeToCheck=" + StringUtils.humanSize(sizeToCheck) + + ", regionsWithCommonTable=" + tableRegionsCount); + return true; + } + return false; + } Review comment: > Thought it agian, split by store size cause the actual region split size uncontrollable and easy to misunderstand, as hbase do more and more better on many columnfamilies, the disadvantages will more and more obvious, so i think we should change the default behavior to split by all reigon size. That's my concern. It may cause regions to grow much beyond the desired _hbase.hregion.max.filesize_. > Maybe we'd better to introduce this new split policy as optional first, and make it as default in future if it works well? Yes, and maybe we should raise a discussion on dev list about making _ IncreasingToUpperBoundRegionSplitPolicy_ deprecated? ---------------------------------------------------------------- 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]
