From 39ec28a179f1008c99c1210b471cefb4d67e39fa Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Wed, 16 Jan 2019 14:22:59 +0800 Subject: [PATCH] HBASE-21731 Do not need to use ClusterConnection in IntegrationTestBigLinkedListWithVisibility --- ...rationTestBigLinkedListWithVisibility.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedListWithVisibility.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedListWithVisibility.java index a8c595a5fd..3a94ca4762 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedListWithVisibility.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedListWithVisibility.java @@ -450,24 +450,24 @@ public class IntegrationTestBigLinkedListWithVisibility extends IntegrationTestB @Override protected void handleFailure(Counters counters) throws IOException { - Configuration conf = job.getConfiguration(); - ClusterConnection conn = (ClusterConnection) ConnectionFactory.createConnection(conf); - TableName tableName = TableName.valueOf(COMMON_TABLE_NAME); - CounterGroup g = counters.getGroup("undef"); - Iterator it = g.iterator(); - while (it.hasNext()) { - String keyString = it.next().getName(); - byte[] key = Bytes.toBytes(keyString); - HRegionLocation loc = conn.relocateRegion(tableName, key); - LOG.error("undefined row " + keyString + ", " + loc); - } - g = counters.getGroup("unref"); - it = g.iterator(); - while (it.hasNext()) { - String keyString = it.next().getName(); - byte[] key = Bytes.toBytes(keyString); - HRegionLocation loc = conn.relocateRegion(tableName, key); - LOG.error("unreferred row " + keyString + ", " + loc); + try (Connection conn = ConnectionFactory.createConnection(job.getConfiguration())) { + TableName tableName = TableName.valueOf(COMMON_TABLE_NAME); + CounterGroup g = counters.getGroup("undef"); + Iterator it = g.iterator(); + while (it.hasNext()) { + String keyString = it.next().getName(); + byte[] key = Bytes.toBytes(keyString); + HRegionLocation loc = conn.getRegionLocator(tableName).getRegionLocation(key, true); + LOG.error("undefined row " + keyString + ", " + loc); + } + g = counters.getGroup("unref"); + it = g.iterator(); + while (it.hasNext()) { + String keyString = it.next().getName(); + byte[] key = Bytes.toBytes(keyString); + HRegionLocation loc = conn.getRegionLocator(tableName).getRegionLocation(key, true); + LOG.error("unreferred row " + keyString + ", " + loc); + } } } } -- 2.17.1