@Override
  public long splitRegion(final RegionInfo regionInfo, final byte[] splitRow, final long nonceGroup,
    final long nonce) throws IOException {
    checkInitialized();

    if (!isSplitOrMergeEnabled(MasterSwitchType.SPLIT)) {
      LOG.warn("Split switch is off! skip split of " + regionInfo);
      throw new DoNotRetryIOException(
        "Split region " + regionInfo.getRegionNameAsString() + " failed due to split switch off");
    }

    if (!getTableDescriptors().get(regionInfo.getTable()).isSplitEnabled()) {
      LOG.warn("Split is disabled for the table! Skipping split of {}", regionInfo);
      throw new DoNotRetryIOException("Split region " + regionInfo.getRegionNameAsString()
        + " failed as region split is disabled for the table");
    }

    return MasterProcedureUtil
      .submitProcedure(new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {
        @Override
        protected void run() throws IOException {
          getMaster().getMasterCoprocessorHost().preSplitRegion(regionInfo.getTable(), splitRow);
          LOG.info(getClientIdAuditPrefix() + " split " + regionInfo.getRegionNameAsString());

          // Execute the operation asynchronously
          submitProcedure(getAssignmentManager().createSplitProcedure(regionInfo, splitRow));
        }

        @Override
        protected String getDescription() {
          return "SplitTableProcedure";
        }
      });
  }
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