private static boolean deleteMetaTableDirectoryIfPartial(FileSystem rootDirectoryFs,
    Path metaTableDir) throws IOException {
    boolean isPartial = true;
    try {
      TableDescriptor metaDescriptor =
        FSTableDescriptors.getTableDescriptorFromFs(rootDirectoryFs, metaTableDir);
      // when entering the state of INIT_META_WRITE_FS_LAYOUT, if a meta table directory is found,
      // the meta table should not have any useful data and considers as partial.
      // if we find any valid HFiles, operator should fix the meta e.g. via HBCK.
      if (metaDescriptor != null && metaDescriptor.getColumnFamilyCount() > 0) {
        RemoteIterator<LocatedFileStatus> iterator = rootDirectoryFs.listFiles(metaTableDir, true);
        while (iterator.hasNext()) {
          LocatedFileStatus status = iterator.next();
          if (
            StoreFileInfo.isHFile(status.getPath())
              && HFile.isHFileFormat(rootDirectoryFs, status.getPath())
          ) {
            isPartial = false;
            break;
          }
        }
      }
    } finally {
      if (!isPartial) {
        throw new IOException("Meta table is not partial, please sideline this meta directory "
          + "or run HBCK to fix this meta table, e.g. rebuild the server hostname in ZNode for the "
          + "meta region");
      }
      return rootDirectoryFs.delete(metaTableDir, true);
    }

  }
This procedure is used to initialize meta table for a new hbase deploy. It will just schedule an
{@link TransitRegionStateProcedure} to assign meta.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/InitMetaProcedure.java