brfrn169 commented on a change in pull request #3099:
URL: https://github.com/apache/hbase/pull/3099#discussion_r603709462



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyPrefixRegionSplitPolicy.java
##########
@@ -77,12 +81,51 @@ protected void configureForRegion(HRegion region) {
       LOG.error("Invalid value for " + PREFIX_LENGTH_KEY + " for table "
           + region.getTableDescriptor().getTableName() + ":"
           + prefixLengthString + ". Using default RegionSplitPolicy");
+      return;
+    }
+
+    // read the base region split policy class name from the table descriptor
+    String baseRegionSplitPolicyClassName = 
region.getTableDescriptor().getValue(
+      BASE_REGION_SPLIT_POLICY_CLASS_KEY);
+    if (baseRegionSplitPolicyClassName == null) {
+      baseRegionSplitPolicyClassName = 
RegionSplitPolicy.DEFAULT_SPLIT_POLICY_CLASS.getName();
     }
+
+    try {
+      baseRegionSplitPolicy = 
newBaseRegionSplitPolicy(baseRegionSplitPolicyClassName);
+    } catch (Exception e) {
+      LOG.error("Invalid class for " + BASE_REGION_SPLIT_POLICY_CLASS_KEY + " 
for table "
+        + region.getTableDescriptor().getTableName() + ":"
+        + baseRegionSplitPolicyClassName + ". Using default 
RegionSplitPolicy", e);
+      try {
+        baseRegionSplitPolicy =
+          
newBaseRegionSplitPolicy(RegionSplitPolicy.DEFAULT_SPLIT_POLICY_CLASS.getName());
+      } catch (Exception ignored) {
+      }
+    }
+    baseRegionSplitPolicy.configureForRegion(region);
+  }

Review comment:
       Yes, it's repeated. I will fix this duplication. 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:
us...@infra.apache.org


Reply via email to