This is an automated email from the ASF dual-hosted git repository.
liuxiaocs pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.6 by this push:
new c36ea407518 Revert "HBASE-29950 Add a shell command for reopen table
regions (#7832) (#7973)"
c36ea407518 is described below
commit c36ea4075180d54f534f293aee01e4e043450ba8
Author: liuxiaocs7 <[email protected]>
AuthorDate: Sun Apr 5 11:29:07 2026 +0800
Revert "HBASE-29950 Add a shell command for reopen table regions (#7832)
(#7973)"
This reverts commit 9567f1bbbf9c67395b7e987f7f7b2ca8654014b5.
---
hbase-shell/src/main/ruby/hbase/admin.rb | 28 ---------
hbase-shell/src/main/ruby/shell.rb | 1 -
.../src/main/ruby/shell/commands/reopen_regions.rb | 37 ------------
.../test/ruby/hbase/reopen_regions_test_cluster.rb | 66 ----------------------
4 files changed, 132 deletions(-)
diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb
b/hbase-shell/src/main/ruby/hbase/admin.rb
index 72ab3678b31..c7f8a2b095c 100644
--- a/hbase-shell/src/main/ruby/hbase/admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/admin.rb
@@ -583,34 +583,6 @@ module Hbase
@admin.move(encoded_region_name.to_java_bytes, server ?
server.to_java_bytes : nil)
end
-
#----------------------------------------------------------------------------------------------
- # Reopen regions of a table
- def reopen_regions(table_name, regions = nil)
- table_name_obj = TableName.valueOf(table_name)
- if regions.nil? || regions.empty?
- @admin.reopenTableRegions(table_name_obj)
- else
- # Get all regions of the table
- all_regions = @admin.getRegions(table_name_obj)
- target_regions = java.util.ArrayList.new
-
- regions.each do |r|
- # r could be encoded name or full name
- found = false
- all_regions.each do |region_info|
- if region_info.getEncodedName == r ||
region_info.getRegionNameAsString == r
- target_regions.add(region_info)
- found = true
- break
- end
- end
- raise ArgumentError, "Region #{r} not found in table #{table_name}"
unless found
- end
-
- @admin.reopenTableRegions(table_name_obj, target_regions)
- end
- end
-
#----------------------------------------------------------------------------------------------
# Merge multiple regions
def merge_region(regions, force)
diff --git a/hbase-shell/src/main/ruby/shell.rb
b/hbase-shell/src/main/ruby/shell.rb
index 20c66ad63e6..70aa7b8ae61 100644
--- a/hbase-shell/src/main/ruby/shell.rb
+++ b/hbase-shell/src/main/ruby/shell.rb
@@ -451,7 +451,6 @@ Shell.load_command_group(
normalizer_enabled
is_in_maintenance_mode
clear_slowlog_responses
- reopen_regions
close_region
compact
compaction_switch
diff --git a/hbase-shell/src/main/ruby/shell/commands/reopen_regions.rb
b/hbase-shell/src/main/ruby/shell/commands/reopen_regions.rb
deleted file mode 100644
index 1f7e6906b5d..00000000000
--- a/hbase-shell/src/main/ruby/shell/commands/reopen_regions.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-#
-# 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.
-#
-
-module Shell
- module Commands
- class ReopenRegions < Command
- def help
- <<-EOF
-Reopen all regions of a table or specific regions of a table.
-Examples:
- hbase> reopen_regions 'TABLE_NAME'
- hbase> reopen_regions 'TABLE_NAME', ['REGION_NAME1', 'REGION_NAME2']
-EOF
- end
-
- def command(table_name, regions = nil)
- admin.reopen_regions(table_name, regions)
- end
- end
- end
-end
diff --git a/hbase-shell/src/test/ruby/hbase/reopen_regions_test_cluster.rb
b/hbase-shell/src/test/ruby/hbase/reopen_regions_test_cluster.rb
deleted file mode 100644
index 6a1eada5267..00000000000
--- a/hbase-shell/src/test/ruby/hbase/reopen_regions_test_cluster.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-#
-# 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.
-#
-
-require 'hbase_shell'
-require 'stringio'
-require 'hbase_constants'
-require 'hbase/hbase'
-require 'hbase/table'
-
-module Hbase
- class ReopenRegionsTest < Test::Unit::TestCase
- include TestHelpers
-
- def setup
- setup_hbase
- # Create test table if it does not exist
- @test_name = "hbase_reopen_regions_test_table"
- create_test_table(@test_name)
- end
-
- def teardown
- shutdown
- end
-
- define_test "reopen_regions should work for all regions" do
- assert_nothing_raised do
- command(:reopen_regions, @test_name)
- end
- end
-
- define_test "reopen_regions should work for specific regions" do
- # Get Java Admin to fetch regions
- java_admin = admin.instance_variable_get(:@admin)
- regions =
java_admin.getRegions(org.apache.hadoop.hbase.TableName.valueOf(@test_name))
-
- assert(regions.size > 0, "Test table should have regions")
- region_encoded_name = regions.get(0).getEncodedName
-
- assert_nothing_raised do
- command(:reopen_regions, @test_name, [region_encoded_name])
- end
- end
-
- define_test "reopen_regions should raise error for non-existent region" do
- assert_raise(ArgumentError) do
- command(:reopen_regions, @test_name, ['non-existent-region'])
- end
- end
- end
-end