From 5f95ec626570c4d42fc8084090733b9a8a0cbe5f Mon Sep 17 00:00:00 2001 From: stack Date: Sat, 3 Oct 2015 13:31:43 -0700 Subject: [PATCH] HBASE-14545 TestMasterFailover often times out --- .../main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java | 4 +++- .../java/org/apache/hadoop/hbase/master/RegionStates.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java index eae041b5f7c..fbe590f71c1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java @@ -144,7 +144,9 @@ public class LocalHBaseCluster { // clash over default ports. conf.set(HConstants.MASTER_PORT, "0"); conf.set(HConstants.REGIONSERVER_PORT, "0"); - conf.set(HConstants.REGIONSERVER_INFO_PORT, "0"); + if (conf.getInt(HConstants.REGIONSERVER_INFO_PORT, 0) != -1) { + conf.set(HConstants.REGIONSERVER_INFO_PORT, "0"); + } this.masterClass = (Class) conf.getClass(HConstants.MASTER_IMPL, masterClass); 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 a200cdb7eec..174c9c39e04 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 @@ -167,10 +167,10 @@ public class RegionStates { } /** - * @return an unmodifiable the region assignment map + * @return a copy of the region assignment map */ public synchronized Map getRegionAssignments() { - return Collections.unmodifiableMap(regionAssignments); + return new TreeMap(regionAssignments); } /**