private void cleanupFailedOpen(final HRegion region) throws IOException { if (region != null) { this.rsServices.removeRegion(region, null); region.close(); } }
@Override public void run() { // wait for the chore to complete and call close try { ((HRegion) region).close(); } catch (IOException e) { closeException.set(e); } } };
/** * Creates, flushes, and closes a new region. */ public static HRegion createHDFSRegionDir(Configuration conf, RegionInfo hri, TableDescriptor htd) throws IOException { // Create HRegion Path root = FSUtils.getRootDir(conf); HRegion region = HRegion.createHRegion(hri, root, conf, htd, null); // Close the new region to flush to disk. Close log file too. region.close(); return region; }
@After public void tearDown() throws IOException { if (region != null) { region.close(); } }
@After public void after() throws IOException { this.region.close(); }
@AfterClass public static void tearDownAfterClass() throws Exception { REGION.close(); }
@After public void tearDown() throws Exception { region.close(); fs.delete(UTIL.getDataTestDir(), true); }
@After public void tearDown() throws IOException { REGION.close(true); UTIL.cleanupTestDir(); }
private void closeRegion(final HRegion region) throws IOException { if (region != null) { region.close(); WAL wal = region.getWAL(); if (wal != null) { wal.shutdown(); } } }
@After public void tearDown() throws Exception { EnvironmentEdgeManagerTestHelper.reset(); if (region != null) region.close(true); }
private void closeRegion(final HRegion region) throws IOException { region.close(); region.getWAL().close(); }
@After public void tearDown() throws Exception { region.close(); region.getFilesystem().delete(UTIL.getDataTestDir(), true); }
@After public void tearDown() throws Exception { WAL wal = ((HRegion)region).getWAL(); ((HRegion)region).close(); wal.close(); }
/** * Close both the HRegion {@code r} and it's underlying WAL. For use in tests. */ public static void closeRegionAndWAL(final HRegion r) throws IOException { if (r == null) return; r.close(); if (r.getWAL() == null) return; r.getWAL().close(); }
@After public void tearDown() throws Exception { WAL wal = ((HRegion)r).getWAL(); ((HRegion)r).close(); wal.close(); }
@After public void tearDown() throws Exception { WAL wal = r.getWAL(); this.r.close(); wal.close(); }
@After public void tearDown() throws Exception { WAL wal = ((HRegion)r).getWAL(); ((HRegion)r).close(); wal.close(); }
@After public void teardown() throws IOException { if (region != null) { CacheConfig cacheConfig = region.getStores().get(0).getCacheConfig(); region.close(); WAL wal = region.getWAL(); if (wal != null) { wal.close(); } cacheConfig.getBlockCache().ifPresent(BlockCache::shutdown); region = null; } }
@Test public void testOpeningReadOnlyRegionBasic() throws Exception { String snapshotDir = client.createSnapshot(baseDir, SNAPSHOT_NAME); RegionInfo firstRegion = TEST_UTIL.getConnection().getRegionLocator( table.getName()).getAllRegionLocations().stream().findFirst().get().getRegion(); Path tableDir = FSUtils.getTableDir(new Path(snapshotDir), TABLE_NAME); HRegion snapshottedRegion = openSnapshotRegion(firstRegion, tableDir); Assert.assertNotNull(snapshottedRegion); snapshottedRegion.close(); }
@Override public Object run() throws Exception { runWALSplit(newConf); WAL wal2 = createWAL(newConf, hbaseRootDir, logName); HRegion region2 = HRegion.openHRegion(newConf, FileSystem.get(newConf), hbaseRootDir, hri, htd, wal2); long seqid2 = region2.getOpenSeqNum(); assertTrue(seqid2 > -1); assertEquals(rowsInsertedCount, getScannedCount(region2.getScanner(new Scan()))); // I can't close wal1. Its been appropriated when we split. region2.close(); wal2.close(); return null; } });