@Override public void close() throws IOException { adm.close(); } }
@Override public void close() throws IOException { if (this.admin != null) this.admin.close(); }
@Override public void close() throws IOException { if (this.connection != null) { this.connection.close(); } admin.close(); }
@Override public void close() throws IOException { if (admin != null) { Connection connection = admin.getConnection(); admin.close(); admin = null; if (connection != null) { connection.close(); } } } }
@AfterClass public static void tearDownAfterClass() throws Exception { tableExecutorService.shutdown(); hbfsckExecutorService.shutdown(); admin.close(); TEST_UTIL.shutdownMiniCluster(); }
@AfterClass public static void tearDownAfterClass() throws Exception { if (ADMIN != null) { ADMIN.close(); } UTIL.shutdownMiniCluster(); }
@AfterClass public static void tearDownAfterClass() throws Exception { if (ADMIN != null) ADMIN.close(); UTIL.shutdownMiniCluster(); }
@After public void tearDown() throws Exception { // Set to true while stopping cluster hasAccess = true; admin.close(); UTIL.shutdownMiniCluster(); }
@AfterClass public static void afterAllTests() throws Exception { TEST_UTIL.shutdownMiniCluster(); if (ADMIN != null) ADMIN.close(); }
@AfterClass public static void tearDownAfterClass() throws Exception { hbaseAdmin.close(); TEST_UTIL.shutdownMiniCluster(); }
@Override public void close() throws IOException { if (this.admin != null) { admin.close(); } if (this.connection != null && !this.connection.isClosed()) { this.connection.close(); } }
@BeforeClass public static void beforeClass() throws Exception { UTIL.getConfiguration().set("hbase.client.retries.number", "3"); UTIL.startMiniCluster(); Admin admin = UTIL.getAdmin(); HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(tableAname)); for (HColumnDescriptor family : families) { tableDescriptor.addFamily(family); } admin.createTable(tableDescriptor); admin.close(); }
@After public void tearDown() throws Exception { this.admin.close(); for (TableDescriptor htd: this.admin.listTableDescriptors()) { LOG.info("Tear down, remove table=" + htd.getTableName()); TESTING_UTIL.deleteTable(htd.getTableName()); } }
private List<HRegionLocation> splitTable(final Table t) throws IOException, InterruptedException { // Split this table in two. Admin admin = TEST_UTIL.getAdmin(); admin.split(t.getName()); admin.close(); List<HRegionLocation> regions = waitOnSplit(t); assertTrue(regions.size() > 1); return regions; }
@Override public Object run() throws Exception { Connection unmanagedConnection = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration()); Admin admin = unmanagedConnection.getAdmin(); try { return Arrays.asList(admin.listTableNames()); } finally { admin.close(); unmanagedConnection.close(); } } };
@AfterClass public static void tearDownAfterClass() throws Exception { if (ADMIN != null) ADMIN.close(); if (CONNECTION != null && !CONNECTION.isClosed()) CONNECTION.close(); TEST_UTIL.shutdownMiniCluster(); }
@After public void tearDown() throws Exception { UTIL.deleteTable(TABLE_NAME); SnapshotTestingUtils.deleteAllSnapshots(this.admin); this.admin.close(); SnapshotTestingUtils.deleteArchiveDirectory(UTIL); }
@After public void tearDown() throws Exception { admin.disableTable(tableName); admin.deleteTable(tableName); admin.close(); TEST_UTIL.shutdownMiniCluster(); TEST_UTIL.getTestFileSystem().delete(TEST_UTIL.getDataTestDir(), true); }
@Test public void testMultiSwitches() throws IOException { Admin admin = TEST_UTIL.getAdmin(); boolean[] switches = admin.setSplitOrMergeEnabled(false, false, MasterSwitchType.SPLIT, MasterSwitchType.MERGE); for (boolean s : switches){ assertTrue(s); } assertFalse(admin.isSplitOrMergeEnabled(MasterSwitchType.SPLIT)); assertFalse(admin.isSplitOrMergeEnabled(MasterSwitchType.MERGE)); admin.close(); }