static public String checksumFor(Path path, FileSystem fs) throws IOException {
    // TODO: fs checksum only available on hdfs, need to
    //       find a solution for other fs (eg, local fs, s3, etc)
    String checksumString = null;
    FileChecksum checksum = fs.getFileChecksum(path);
    if (checksum != null) {
      checksumString = StringUtils.byteToHexString(
          checksum.getBytes(), 0, checksum.getLength());
    }
    return checksumString;
  }
Move a path into cmroot. If the path is a directory (of a partition, or table if nonpartitioned),
  recursively move files inside directory to cmroot. Note the table must be managed table
@param path a single file or directory
@param type if the files to be copied or moved to cmpath.
            Copy is costly but preserve the source file
@param ifPurge if the file should skip Trash when move/delete source file.
               This is referred only if type is MOVE.
@return int
@throws IOException
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/ReplChangeManager.java