/** * Recover the tables that are not fully moved to ENABLED state. These tables * are in ENABLING state when the master restarted/switched * * @throws org.apache.zookeeper.KeeperException * @throws com.alibaba.wasp.TableNotFoundException * @throws java.io.IOException */ private void recoverTableInEnablingState() throws KeeperException, TableNotFoundException, IOException { Set<String> enablingTables = ZKTable.getEnablingTables(watcher); if (enablingTables.size() != 0) { for (String tableName : enablingTables) { // Recover by calling EnableTableHandler LOG.info("The table " + tableName + " is in ENABLING state. Hence recovering by moving the table" + " to ENABLED state."); // enableTable in sync way during master startup, new EnableTableHandler(this.server, (FMasterServices) this.server,this, tableName.getBytes(), true) .process(); } } }
disabledOrDisablingOrEnabling.addAll(ZKTable.getEnablingTables(watcher));
Set<String> enablingTables = ZKTable.getEnablingTables(watcher); Set<String> disabledOrEnablingTables = ZKTable.getDisabledTables(watcher); disabledOrEnablingTables.addAll(enablingTables);