bsglz commented on a change in pull request #1909:
URL: https://github.com/apache/hbase/pull/1909#discussion_r442090161
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/HDFSBlocksDistribution.java
##########
@@ -256,6 +256,9 @@ public float getBlockLocalityIndexForSsd(String host) {
private float getBlockLocalityIndexInternal(String host, Visitor visitor) {
float localityIndex = 0;
HostAndWeight hostAndWeight = this.hostAndWeights.get(host);
+ if (hostAndWeight == null) {
+ hostAndWeight = this.hostAndWeights.get(HConstants.LOCALHOST);
Review comment:
> We want to get from the map only when host is localhost? So, we should
have condition on host rather than having nullable check on hostAndWeight.
The logic is, try to get from the map using host first, if failed, then
using "localhost".
> Small UT to test this is possible?
Ok, let me try.
----------------------------------------------------------------
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]