private void prepareModify(final MasterProcedureEnv env) throws IOException {
    // Checks whether the table exists
    if (!env.getMasterServices().getTableDescriptors().exists(getTableName())) {
      throw new TableNotFoundException(getTableName());
    }

    // check that we have at least 1 CF
    if (modifiedTableDescriptor.getColumnFamilyCount() == 0) {
      throw new DoNotRetryIOException(
        "Table " + getTableName().toString() + " should have at least one column family.");
    }

    // If descriptor check is enabled, check whether the table descriptor when procedure was
    // submitted matches with the current
    // table descriptor of the table, else retrieve the old descriptor
    // for comparison in order to update the descriptor.
    if (shouldCheckDescriptor) {
      if (
        TableDescriptor.COMPARATOR.compare(unmodifiedTableDescriptor,
          env.getMasterServices().getTableDescriptors().get(getTableName())) != 0
      ) {
        LOG.error("Error while modifying table '" + getTableName().toString()
          + "' Skipping procedure : " + this);
        throw new ConcurrentTableModificationException(
          "Skipping modify table operation on table '" + getTableName().toString()
            + "' as it has already been modified by some other concurrent operation, "
            + "Please retry.");
      }
    } else {
      this.unmodifiedTableDescriptor =
        env.getMasterServices().getTableDescriptors().get(getTableName());
    }

    this.deleteColumnFamilyInModify =
      isDeleteColumnFamily(unmodifiedTableDescriptor, modifiedTableDescriptor);
    if (
      !unmodifiedTableDescriptor.getRegionServerGroup()
        .equals(modifiedTableDescriptor.getRegionServerGroup())
    ) {
      Supplier<String> forWhom = () -> "table " + getTableName();
      RSGroupInfo rsGroupInfo = MasterProcedureUtil.checkGroupExists(
        env.getMasterServices().getRSGroupInfoManager()::getRSGroup,
        modifiedTableDescriptor.getRegionServerGroup(), forWhom);
      MasterProcedureUtil.checkGroupNotEmpty(rsGroupInfo, forWhom);
    }

    // check for store file tracker configurations
    StoreFileTrackerValidationUtils.checkForModifyTable(env.getMasterConfiguration(),
      unmodifiedTableDescriptor, modifiedTableDescriptor, !isTableEnabled(env));
  }
Check conditions before any real action of modifying a table.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ModifyTableProcedure.java