From 716722123e16b3f69359781e8a1dc2695342f0bb Mon Sep 17 00:00:00 2001 From: SiCheng-Zheng <643463623@qq.com> Date: Fri, 11 Nov 2022 11:29:44 +0800 Subject: [PATCH] HBASE-27309 Add major compact table or region operation on master web table page --- .../resources/hbase-webapps/master/table.jsp | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp index 84718edbc44d..2e3c32b298c6 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp @@ -191,6 +191,19 @@ } %> Split request accepted. <% + } else if (action.equals("major compact")) { + if (key != null && key.length() > 0) { + List regions = admin.getRegions(TableName.valueOf(fqtn)).get(); + byte[] row = Bytes.toBytes(key); + for (RegionInfo region : regions) { + if (region.containsRow(row)) { + admin.majorCompactRegion(region.getRegionName()); + } + } + } else { + admin.majorCompact(TableName.valueOf(fqtn)); + } + %> major Compact request accepted. <% } else if (action.equals("compact")) { if (key != null && key.length() > 0) { List regions = admin.getRegions(TableName.valueOf(fqtn)).get(); @@ -1187,6 +1200,23 @@

+ + + + + + + + +
+ + + + + This action will force a major compaction of all regions of the table, or, + if a key is supplied, only the region major containing the + given key. +