/** * Mark table state to Disabled * @param env MasterProcedureEnv */ protected static void setTableStateToDisabled(final MasterProcedureEnv env, final TableName tableName) throws IOException { // Flip the table to disabled env.getMasterServices().getTableStateManager().setTableState(tableName, TableState.State.DISABLED); LOG.info("Set {} to state={}", tableName, TableState.State.DISABLED); }
/** * Mark table state to Disabling * @param env MasterProcedureEnv */ private static void setTableStateToDisabling(final MasterProcedureEnv env, final TableName tableName) throws IOException { // Set table disabling flag up in zk. env.getMasterServices().getTableStateManager().setTableState(tableName, TableState.State.DISABLING); LOG.info("Set {} to state={}", tableName, TableState.State.DISABLING); }
/** * Mark table state to Enabling * @param env MasterProcedureEnv * @param tableName the target table * @throws IOException */ protected static void setTableStateToEnabling( final MasterProcedureEnv env, final TableName tableName) throws IOException { // Set table disabling flag up in zk. LOG.info("Attempting to enable the table " + tableName); env.getMasterServices().getTableStateManager().setTableState( tableName, TableState.State.ENABLING); }
protected static void setEnablingState(final MasterProcedureEnv env, final TableName tableName) throws IOException { // Mark the table as Enabling env.getMasterServices().getTableStateManager() .setTableState(tableName, TableState.State.ENABLING); }
/** * Mark table state to Enabled * @param env MasterProcedureEnv * @throws IOException */ protected static void setTableStateToEnabled( final MasterProcedureEnv env, final TableName tableName) throws IOException { // Flip the table to Enabled env.getMasterServices().getTableStateManager().setTableState( tableName, TableState.State.ENABLED); LOG.info("Table '" + tableName + "' was successfully enabled."); }
protected static void setEnabledState(final MasterProcedureEnv env, final TableName tableName) throws IOException { // Enable table env.getMasterServices().getTableStateManager() .setTableState(tableName, TableState.State.ENABLED); }
moveRegionAndArchiveOldWals(region, rs); TableStateManager tsm = UTIL.getMiniHBaseCluster().getMaster().getTableStateManager(); tsm.setTableState(tableName, TableState.State.ENABLING); Thread t = new Thread(() -> { try { tsm.setTableState(tableName, TableState.State.ENABLED); t.join(); try (Table table = UTIL.getConnection().getTable(tableName)) {
rollAllWALs(); TableStateManager tsm = UTIL.getMiniHBaseCluster().getMaster().getTableStateManager(); tsm.setTableState(tableName, TableState.State.DISABLING); Thread t = new Thread(() -> { try { tsm.setTableState(tableName, TableState.State.DISABLED); t.join(); UTIL.getAdmin().enableTable(tableName);
/** * Update state of the table in meta only. This is required by hbck in some situations to cleanup * stuck assign/ unassign regions procedures for the table. * * @return previous state of the table */ @Override public GetTableStateResponse setTableStateInMeta(RpcController controller, SetTableStateInMetaRequest request) throws ServiceException { TableName tn = ProtobufUtil.toTableName(request.getTableName()); try { HBaseProtos.TableState prevState = this.master.getTableStateManager().getTableState(tn).convert(); this.master.getTableStateManager().setTableState(tn, TableState.convert(tn, request.getTableState()).getState()); return GetTableStateResponse.newBuilder().setTableState(prevState).build(); } catch (Exception e) { throw new ServiceException(e); } }
moveRegionAndArchiveOldWals(region, rs); TableStateManager tsm = UTIL.getMiniHBaseCluster().getMaster().getTableStateManager(); tsm.setTableState(tableName, TableState.State.ENABLING); Thread t = new Thread(() -> { try { tsm.setTableState(tableName, TableState.State.ENABLED); t.join(); try (Table table = UTIL.getConnection().getTable(tableName)) {
rollAllWALs(); TableStateManager tsm = UTIL.getMiniHBaseCluster().getMaster().getTableStateManager(); tsm.setTableState(tableName, TableState.State.DISABLING); Thread t = new Thread(() -> { try { tsm.setTableState(tableName, TableState.State.DISABLED); t.join(); UTIL.getAdmin().enableTable(tableName);