Apache9 commented on a change in pull request #3150:
URL: https://github.com/apache/hbase/pull/3150#discussion_r612069807
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/SplitTableRegionProcedure.java
##########
@@ -110,6 +111,15 @@ public SplitTableRegionProcedure(final MasterProcedureEnv
env,
// we fail-fast on construction. There it skips the split with just a
warning.
checkOnline(env, regionToSplit);
this.bestSplitRow = splitRow;
+ TableDescriptor tableDescriptor =
env.getMasterServices().getTableDescriptors()
+ .get(getTableName());
+ Configuration conf = env.getMasterConfiguration();
+ if (hasBestSplitRow()) {
Review comment:
We do not have this logic in the past? What is changed so now we need to
apply this restriction in SplitTableRegionProcedure? IIRC the logic is done at
region server side?
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyPrefixRegionSplitPointRestriction.java
##########
@@ -0,0 +1,76 @@
+/*
+ * 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 java.io.IOException;
+import java.util.Arrays;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A RegionSplitPointRestriction implementation that groups rows by a prefix
of the row-key.
+ *
+ * This ensures that a region is not split "inside" a prefix of a row key.
+ * I.e. rows can be co-located in a region by their prefix.
+ */
[email protected]
+public class KeyPrefixRegionSplitPointRestriction extends
RegionSplitPointRestriction {
+ private static final Logger LOGGER =
Review comment:
Usually we name it LOG instead of LOGGER in hbase code base.
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NoneRegionSplitPointRestriction.java
##########
@@ -0,0 +1,40 @@
+/*
+ * 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 java.io.IOException;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.yetus.audience.InterfaceAudience;
+
+/**
+ * A RegionSplitPointRestriction implementation that does nothing.
+ */
[email protected]
+public class NoneRegionSplitPointRestriction extends
RegionSplitPointRestriction {
Review comment:
I'm not a native English speaker so I do not have better candidate but I
feel the name is a bit strange...
@saintstack Do you have any suggestions on this? It should be NoRestriction
I think?
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionSplitPointRestriction.java
##########
@@ -0,0 +1,100 @@
+/*
+ * 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 java.io.IOException;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A split point restriction that restricts the pattern of the split point.
+ *
+ * There are three implementations as follows:
+ * @see NoneRegionSplitPointRestriction
+ * @see KeyPrefixRegionSplitPointRestriction
+ * @see DelimitedKeyPrefixRegionSplitPointRestriction
+ */
[email protected]
+public abstract class RegionSplitPointRestriction {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(RegionSplitPointRestriction.class);
Review comment:
LOG.
--
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]