@Override
  public long truncateTable(final TableName tableName, final boolean preserveSplits,
    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().preTruncateTable(tableName);

          LOG.info(getClientIdAuditPrefix() + " truncate " + tableName);
          ProcedurePrepareLatch latch = ProcedurePrepareLatch.createLatch(2, 0);
          submitProcedure(new TruncateTableProcedure(procedureExecutor.getEnvironment(), tableName,
            preserveSplits, latch));
          latch.await();

          getMaster().getMasterCoprocessorHost().postTruncateTable(tableName);
        }

        @Override
        protected String getDescription() {
          return "TruncateTableProcedure";
        }
      });
  }
Switch for the background CatalogJanitor thread. Used for testing. The thread will continue to
run. It will just be a noop if disabled.
@param b If false, the catalog janitor won't do anything.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java