From 2c5825d897727d95d62ea1465792bb5a7a09db96 Mon Sep 17 00:00:00 2001 From: Jimmy Xiang Date: Fri, 15 Aug 2014 10:36:49 -0700 Subject: [PATCH] HBASE-11740 RegionStates.getRegionAssignments() gets stuck on clone (Virag Kothari) --- .../java/org/apache/hadoop/hbase/master/RegionStates.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java index 36bc8e28ba1..a29d675e287 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java @@ -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 getRegionAssignments() { - return (Map)regionAssignments.clone(); + return Collections.unmodifiableMap(regionAssignments); } /**