HBASE-22661 list_regions command in hbase shell is broken

Signed-off-by: Guanghao Zhang <zghao@apache.org>
This commit is contained in:
Duo Zhang 2019-07-15 23:06:43 +08:00
parent e5f05bf119
commit ae7ffccfb8
2 changed files with 6 additions and 2 deletions

View File

@ -82,7 +82,7 @@ EOF
error = false
admin_instance = admin.instance_variable_get('@admin')
conn_instance = admin_instance.getConnection
cluster_status = admin_instance.getClusterStatus
cluster_status = org.apache.hadoop.hbase.ClusterStatus.new(admin_instance.getClusterMetrics)
hregion_locator_instance = conn_instance.getRegionLocator(TableName.valueOf(table_name))
hregion_locator_list = hregion_locator_instance.getAllRegionLocations.to_a
results = []
@ -103,7 +103,7 @@ EOF
end
regions.each do |hregion|
hregion_info = hregion.getRegionInfo
hregion_info = hregion.getRegion
server_name = hregion.getServerName
region_load_map = cluster_status.getLoad(server_name).getRegionsLoad
region_load = region_load_map.get(hregion_info.getRegionName)

View File

@ -518,6 +518,10 @@ module Hbase
encodedRegionName = region.getRegion.getEncodedName
command(:unassign, encodedRegionName, true)
end
define_test "list regions should allow table name" do
command(:list_regions, @test_name)
end
end
# Simple administration methods tests