busbey commented on a change in pull request #46: HBASE-23562 [operator tools] 
Add a RegionsMerge tool that allows for …
URL: 
https://github.com/apache/hbase-operator-tools/pull/46#discussion_r360516416
 
 

 ##########
 File path: hbase-tools/src/main/java/org/apache/hbase/RegionsMerger.java
 ##########
 @@ -0,0 +1,213 @@
+/*
+ * 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.hbase;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.conf.Configured;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
+import org.apache.hadoop.hbase.client.Connection;
+import org.apache.hadoop.hbase.client.ConnectionFactory;
+import org.apache.hadoop.hbase.client.RegionInfo;
+import org.apache.hadoop.hbase.util.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.LongAdder;
+
+/**
+ * HBase maintenance tool for merging regions of a specific table, until a 
target number of regions
+ * for the table is reached, or no more merges can complete due to limit in 
resulting merged
+ * region size.
+ */
+public class RegionsMerger extends Configured implements 
org.apache.hadoop.util.Tool {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(RegionsMerger.class.getName());
+  public static final String RESULTING_REGION_UPPER_MARK = 
"hbase.tools.merge.upper.mark";
+  public static final String SLEEP = "hbase.tools.merge.sleep";
+  public static final String MAX_ROUNDS_IDDLE = 
"hbase.tools.max.iterations.blocked";
+
+  private Configuration conf;
 
 Review comment:
   nit: these can all be final

----------------------------------------------------------------
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


With regards,
Apache Git Services

Reply via email to