@Override protected void run() throws IOException { getMaster().getMasterCoprocessorHost().preDisableTable(tableName); LOG.info(getClientIdAuditPrefix() + " disable " + tableName); // Execute the operation asynchronously - client will check the progress of the operation // In case the request is from a <1.1 client before returning, // we want to make sure that the table is prepared to be // enabled (the table is locked and the table state is set). // Note: if the procedure throws exception, we will catch it and rethrow. // // We need to wait for the procedure to potentially fail due to "prepare" sanity // checks. This will block only the beginning of the procedure. See HBASE-19953. final ProcedurePrepareLatch prepareLatch = ProcedurePrepareLatch.createBlockingLatch(); submitProcedure(new DisableTableProcedure(procedureExecutor.getEnvironment(), tableName, false, prepareLatch)); prepareLatch.await(); getMaster().getMasterCoprocessorHost().postDisableTable(tableName); }
public void disableTable(final byte [] tableName) throws IOException { checkInitialized(); if (cpHost != null) { cpHost.preDisableTable(tableName); } this.executorService.submit(new DisableTableHandler(this, tableName, catalogTracker, assignmentManager, false)); if (cpHost != null) { cpHost.postDisableTable(tableName); } }
@Override public long disableTable( final TableName tableName, final long nonceGroup, final long nonce) throws IOException { checkInitialized(); if (cpHost != null) { cpHost.preDisableTable(tableName); } LOG.info(getClientIdAuditPrefix() + " disable " + tableName); // Execute the operation asynchronously - client will check the progress of the operation final ProcedurePrepareLatch prepareLatch = ProcedurePrepareLatch.createLatch(); // Execute the operation asynchronously - client will check the progress of the operation long procId = this.procedureExecutor.submitProcedure( new DisableTableProcedure(procedureExecutor.getEnvironment(), tableName, false, prepareLatch), nonceGroup, nonce); // Before returning to client, we want to make sure that the table is prepared to be // enabled (the table is locked and the table state is set). // // Note: if the procedure throws exception, we will catch it and rethrow. prepareLatch.await(); if (cpHost != null) { cpHost.postDisableTable(tableName); } return procId; }