Apache9 commented on a change in pull request #426: HBASE-22695 Store the
rsgroup of a table in table configuration
URL: https://github.com/apache/hbase/pull/426#discussion_r310130785
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServiceImpl.java
##########
@@ -276,14 +321,28 @@ public void balanceRSGroup(RpcController controller,
BalanceRSGroupRequest reque
public void listRSGroupInfos(RpcController controller,
ListRSGroupInfosRequest request,
RpcCallback<ListRSGroupInfosResponse> done) {
ListRSGroupInfosResponse.Builder builder =
ListRSGroupInfosResponse.newBuilder();
- RSGroupAdminEndpoint.LOG.info(master.getClientIdAuditPrefix() + " list
rsgroup");
+ LOG.info(master.getClientIdAuditPrefix() + " list rsgroup");
try {
if (master.getMasterCoprocessorHost() != null) {
master.getMasterCoprocessorHost().preListRSGroups();
}
checkPermission("listRSGroup");
- for (RSGroupInfo RSGroupInfo : groupAdminServer.listRSGroups()) {
- builder.addRSGroupInfo(ProtobufUtil.toProtoGroupInfo(RSGroupInfo));
+ List<RSGroupInfo> rsGroupInfos = groupAdminServer.listRSGroups().stream()
+ .map(RSGroupInfo::new).collect(Collectors.toList());
+ Map<String, RSGroupInfo> name2Info = new HashMap<>();
+ for (RSGroupInfo rsGroupInfo : rsGroupInfos) {
+ name2Info.put(rsGroupInfo.getName(), rsGroupInfo);
+ }
+ for (TableDescriptor td :
master.getTableDescriptors().getAll().values()) {
+ String groupName =
td.getRegionServerGroup().orElse(RSGroupInfo.DEFAULT_GROUP);
+ RSGroupInfo rsGroupInfo = name2Info.get(groupName);
+ if (rsGroupInfo != null) {
+ rsGroupInfo.addTable(td.getTableName());
Review comment:
We need to be compatible with 2.x client I think. And also, we need to
change a lot of tests if we want to change the behavior here. So I suggest that
we do it in 4.0.0.
----------------------------------------------------------------
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]
With regards,
Apache Git Services