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/08/11 07:49:51 UTC

[GitHub] [hbase] Apache9 commented on a change in pull request #1909: HBASE-24569 Get hostAndWeights in addition using localhost if it is n…

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



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/HDFSBlocksDistribution.java
##########
@@ -280,6 +280,18 @@ public long getBlocksLocalWithSsdWeight(String host) {
   private long getBlocksLocalityWeightInternal(String host, Visitor visitor) {
     long localityIndex = 0;
     HostAndWeight hostAndWeight = this.hostAndWeights.get(host);
+    // Compatible with local mode, see HBASE-24569
+    if (hostAndWeight == null) {
+      String currentHost = "";
+      try {
+        currentHost = DNS.getDefaultHost("default", "default");

Review comment:
       Is this time consuming?




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