You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/06/12 14:30:16 UTC

[GitHub] [hbase] bsglz commented on a change in pull request #1883: HBASE-24530 Introduce a split policy similar with SteppingSplitPolicy…

bsglz commented on a change in pull request #1883:
URL: https://github.com/apache/hbase/pull/1883#discussion_r439454248



##########
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;
+
+@InterfaceAudience.Private
+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:
       It seems make sense when write to each store not evenly, but the parameter name exactly confused.
   Maybe we should introduce a new parameter _hbase.region.max.size_ for this new policy and rename the _hbase.hregion.max.filesize_ to _hbase.region.store.max.size_ for the exist policies  in follow-on issue. WDYT?
   Thanks.




----------------------------------------------------------------
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:
users@infra.apache.org