Details
Description
Multiple RS can run on the same host. But in current RegionLocationFinder, mapHostNameToServerName map one host to only one server. This will make LocalityCostFunction get wrong locality about region.
// create a mapping from hostname to ServerName for fast lookup HashMap<String, ServerName> hostToServerName = new HashMap<String, ServerName>(); for (ServerName sn : regionServers) { hostToServerName.put(sn.getHostname(), sn); }