diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java index 0e99ab5be3d..1ce14d7ece2 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -318,31 +318,19 @@ public class HConnectionManager { } /** - * Delete information for all connections. Close or not the connection, depending on the - * staleConnection boolean and the ref count. By default, you should use it with - * staleConnection to true. + * Delete information for all connections. */ - public static void deleteAllConnections(boolean staleConnection) { + public static void deleteAllConnections() { synchronized (CONNECTION_INSTANCES) { Set connectionKeys = new HashSet(); connectionKeys.addAll(CONNECTION_INSTANCES.keySet()); for (HConnectionKey connectionKey : connectionKeys) { - deleteConnection(connectionKey, staleConnection); + deleteConnection(connectionKey, false); } CONNECTION_INSTANCES.clear(); } } - /** - * Delete information for all connections.. - * @deprecated kept for backward compatibility, but the behavior is broken. HBASE-8983 - */ - @Deprecated - public static void deleteAllConnections() { - deleteAllConnections(false); - } - - private static void deleteConnection(HConnection connection, boolean staleConnection) { synchronized (CONNECTION_INSTANCES) { for (Entry e: CONNECTION_INSTANCES.entrySet()) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java index fc48f6aa6bc..75cca706850 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java @@ -507,7 +507,7 @@ public class MiniHBaseCluster extends HBaseCluster { if (this.hbaseCluster != null) { this.hbaseCluster.shutdown(); } - HConnectionManager.deleteAllConnections(true); + HConnectionManager.deleteAllConnections(); } @Override diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationDisableInactivePeer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationDisableInactivePeer.java index 1d90d36859b..b089fbe8f29 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationDisableInactivePeer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationDisableInactivePeer.java @@ -28,8 +28,6 @@ import org.apache.hadoop.hbase.util.Bytes; import org.junit.Test; import org.junit.experimental.categories.Category; -import java.util.Map; - import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.fail; @@ -51,7 +49,7 @@ public class TestReplicationDisableInactivePeer extends TestReplicationBase { // enabling and shutdown the peer admin.enablePeer("2"); - utility2.getHBaseCluster().getMaster().shutdown(); + utility2.shutdownMiniHBaseCluster(); byte[] rowkey = Bytes.toBytes("disable inactive peer"); Put put = new Put(rowkey);