HBASE-11740 RegionStates.getRegionAssignments() gets stuck on clone (Virag Kothari)

This commit is contained in:
Jimmy Xiang 2014-08-15 10:36:49 -07:00
parent dbf16df44c
commit 2c5825d897
1 changed files with 2 additions and 2 deletions

View File

@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.master;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@ -144,9 +145,8 @@ public class RegionStates {
/**
* @return an unmodifiable the region assignment map
*/
@SuppressWarnings("unchecked")
public synchronized Map<HRegionInfo, ServerName> getRegionAssignments() {
return (Map<HRegionInfo, ServerName>)regionAssignments.clone();
return Collections.unmodifiableMap(regionAssignments);
}
/**