public static DistributedFileSystem getDFS(Path path, HiveConf conf) throws IOException {
    FileSystem fs = path.getFileSystem(conf);
    if (fs instanceof DistributedFileSystem) {
      return (DistributedFileSystem) fs;
    } else {
      LOG.error("FileSystem for {} is not DistributedFileSystem", path);
      throw new IOException("The filesystem for path {} is {}, The filesystem should be DistributedFileSystem to "
          + "support snapshot based copy.");
    }
  }
Gets a DistributedFileSystem object if possible from a path.
@param path path from which DistributedFileSystem needs to be extracted.
@param conf Hive Configuration.
@return DFS or null.
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/SnapshotUtils.java