You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/09/24 02:39:33 UTC

[GitHub] [hbase] Apache9 commented on a change in pull request #2450: HBASE-25093 the RSGroupBasedLoadBalancer#retainAssignment throws NPE

Apache9 commented on a change in pull request #2450:
URL: https://github.com/apache/hbase/pull/2450#discussion_r494004814



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
##########
@@ -203,8 +203,11 @@ public void setMasterServices(MasterServices masterServices) {
         regionList.forEach(r -> currentAssignmentMap.put(r, regions.get(r)));
         Map<ServerName, List<RegionInfo>> pairResult =
             this.internalBalancer.retainAssignment(currentAssignmentMap, pair.getSecond());
-        pairResult.forEach((server, rs) ->
-            assignments.computeIfAbsent(server, s -> Lists.newArrayList()).addAll(rs));
+        if (pairResult == null || pairResult.isEmpty()) {

Review comment:
       When will retainAssignment return null? If there is no difference between a null and an empty Map, let's just return an empty Map to avoid the null check here?




----------------------------------------------------------------
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:
users@infra.apache.org