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 2019/09/26 16:22:29 UTC

[GitHub] [hbase] saintstack commented on a change in pull request #663: HBASE-23078 BaseLoadBalancer should consider region replicas when ran…

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

 ##########
 File path: hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
 ##########
 @@ -1319,8 +1320,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) {
+          hasRegionReplica = true;
 
 Review comment:
   Good

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


With regards,
Apache Git Services