dumpExecutors(hrs.getExecutorService(), out);
@Test public void testPriorityRegionIsOpenedWithSeparateThreadPool() throws Exception { final TableName tableName = TableName.valueOf(TestRegionOpen.class.getSimpleName()); ThreadPoolExecutor exec = getRS().getExecutorService() .getExecutorThreadPool(ExecutorType.RS_OPEN_PRIORITY_REGION); long completed = exec.getCompletedTaskCount(); HTableDescriptor htd = new HTableDescriptor(tableName); htd.setPriority(HConstants.HIGH_QOS); htd.addFamily(new HColumnDescriptor(HConstants.CATALOG_FAMILY)); try (Connection connection = ConnectionFactory.createConnection(HTU.getConfiguration()); Admin admin = connection.getAdmin()) { admin.createTable(htd); } assertEquals(completed + 1, exec.getCompletedTaskCount()); }
/** * Called when a node has been deleted * @param path full path of the deleted node */ @Override public void nodeDeleted(String path) { if (this.server.isStopped() || this.server.isStopping()) { return; } String parentPath = path.substring(0, path.lastIndexOf('/')); if (!this.watcher.recoveringRegionsZNode.equalsIgnoreCase(parentPath)) { return; } String regionName = path.substring(parentPath.length() + 1); server.getExecutorService().submit(new FinishRegionRecoveringHandler(server, regionName, path)); }
dumpExecutors(hrs.getExecutorService(), out);
dumpExecutors(hrs.getExecutorService(), out);
@Test public void testPriorityRegionIsOpenedWithSeparateThreadPool() throws Exception { final TableName tableName = TableName.valueOf(TestRegionOpen.class.getSimpleName()); ThreadPoolExecutor exec = getRS().getExecutorService() .getExecutorThreadPool(ExecutorType.RS_OPEN_PRIORITY_REGION); long completed = exec.getCompletedTaskCount(); HTableDescriptor htd = new HTableDescriptor(tableName); htd.setPriority(HConstants.HIGH_QOS); htd.addFamily(new HColumnDescriptor(HConstants.CATALOG_FAMILY)); try (Connection connection = ConnectionFactory.createConnection(HTU.getConfiguration()); Admin admin = connection.getAdmin()) { admin.createTable(htd); } assertEquals(completed + 1, exec.getCompletedTaskCount()); }