bsglz commented on a change in pull request #1909:
URL: https://github.com/apache/hbase/pull/1909#discussion_r468676473
##########
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:
```
public static String getDefaultHost(@Nullable String strInterface,
@Nullable String nameserver, boolean tryfallbackResolution) throws
UnknownHostException {
if (strInterface != null && !"default".equals(strInterface)) {
if (nameserver != null && "default".equals(nameserver)) {
nameserver = null;
}
String[] hosts = getHosts(strInterface, nameserver,
tryfallbackResolution);
return hosts[0];
} else {
return cachedHostname;
}
```
It cached in DNS.java(class in hadoop-common) yet.
----------------------------------------------------------------
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]