HBASE-10294 ServerManager#onlineServers synchronization

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1558174 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2014-01-14 19:19:43 +00:00
parent 1951d272a2
commit 405b51a0eb
1 changed files with 3 additions and 1 deletions

View File

@ -421,7 +421,9 @@ public class ServerManager {
*/
public Map<ServerName, ServerLoad> getOnlineServers() {
// Presumption is that iterating the returned Map is OK.
return Collections.unmodifiableMap(this.onlineServers);
synchronized (this.onlineServers) {
return Collections.unmodifiableMap(this.onlineServers);
}
}