infraio commented on a change in pull request #663: HBASE-23078 
BaseLoadBalancer should consider region replicas when ran…
URL: https://github.com/apache/hbase/pull/663#discussion_r329311071
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
 ##########
 @@ -1319,8 +1318,22 @@ protected boolean 
areSomeRegionReplicasColocated(Cluster c) {
     return assignments;
   }
 
-  protected Cluster createCluster(List<ServerName> servers, 
Collection<RegionInfo> regions,
-      boolean hasRegionReplica) {
+  protected Cluster createCluster(List<ServerName> servers, 
Collection<RegionInfo> regions)
+      throws HBaseIOException {
+    boolean hasRegionReplica = false;
+    try {
+      for (RegionInfo regionInfo : regions) {
+        TableName tableName = regionInfo.getTable();
+        if (services != null &&
+            
services.getTableDescriptors().get(tableName).getRegionReplication() > 1) {
 
 Review comment:
   Updated in new patch. Will only getTableDescriptors once now.

----------------------------------------------------------------
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

Reply via email to