long deleteNamespace(final String name, final long nonceGroup, final long nonce)
    throws IOException {
    checkInitialized();

    return MasterProcedureUtil
      .submitProcedure(new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {
        @Override
        protected void run() throws IOException {
          getMaster().getMasterCoprocessorHost().preDeleteNamespace(name);
          LOG.info(getClientIdAuditPrefix() + " delete " + name);
          // Execute the operation synchronously - wait for the operation to complete before
          // continuing.
          //
          // 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.
          ProcedurePrepareLatch latch = ProcedurePrepareLatch.createBlockingLatch();
          setProcId(submitProcedure(
            new DeleteNamespaceProcedure(procedureExecutor.getEnvironment(), name, latch)));
          latch.await();
          // Will not be invoked in the face of Exception thrown by the Procedure's execution
          getMaster().getMasterCoprocessorHost().postDeleteNamespace(name);
        }

        @Override
        protected String getDescription() {
          return "DeleteNamespaceProcedure";
        }
      });
  }
Delete an existing Namespace. Only empty Namespaces (no tables) can be removed.
@param nonceGroup Identifier for the source of the request, a client or process.
@param nonce      A unique identifier for this operation from the client or process identified
                  by <code>nonceGroup</code> (the source must ensure each operation gets a
                  unique id).
@return procedure id
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java