public static void closePool(Configuration configuration) throws IOException{ synchronized (HTABLE_POOLS) { HTABLE_POOLS.remove(configuration).close(); } }
public static void closeAllPools() throws IOException{ synchronized (HTABLE_POOLS) { Iterator<Map.Entry<Configuration, HTablePool>> it = HTABLE_POOLS.entrySet().iterator(); while (it.hasNext()) { Map.Entry<Configuration, HTablePool> entry = it.next(); // closing the table pool will close the connection for every table. entry.getValue().close(); } } }
@Override public void close() throws StorageException { try { pool.close(); } catch (IOException e) { throw new TemporaryStorageException(e); } }
public void close() { if (pool != null) { try { pool.close(); } catch (IOException e) { LOG.error("Close HTable failed ", e); } } if (admin != null) { try { admin.close(); } catch (IOException e) { LOG.error("Close HBaseAdmin failed ", e); } } } }
@After public void afterTest() { try { tablePool.close(); } catch (Exception e) { } }
@After public void afterTest() throws Exception { tablePool.close(); }
@After public void afterTest() throws Exception { tablePool.close(); }
@After public void after() throws Exception { tablePool.close(); HBaseTestUtils.util.deleteTable(Bytes.toBytes(tableName)); HBaseTestUtils.util.truncateTable(Bytes.toBytes(managedTableName)); }
@After public void after() throws Exception { tablePool.close(); HBaseTestUtils.util.truncateTable(Bytes.toBytes(tableName)); HBaseTestUtils.util.truncateTable(Bytes.toBytes(compositeTableName)); HBaseTestUtils.util.truncateTable(Bytes.toBytes(incrementTableName)); HBaseTestUtils.util.truncateTable(Bytes.toBytes(managedTableName)); }