public static boolean isSnapshotAvailable(DistributedFileSystem dfs, Path path, String snapshotPrefix,
      String snapshotName, HiveConf conf) throws IOException {
    AtomicBoolean isSnapAvlb = new AtomicBoolean(false);
    Retryable retryable = Retryable.builder().withHiveConf(conf).withRetryOnException(IOException.class)
        .withFailOnException(SnapshotException.class).build();
    try {
      retryable.executeCallable(() -> {
        isSnapAvlb
            .set(dfs.exists(new Path(path, HdfsConstants.DOT_SNAPSHOT_DIR + "/" + snapshotPrefix + snapshotName)));
        LOG.debug("Snapshot for path {} is {}", path, isSnapAvlb.get() ? "available" : "unavailable");
        return null;
      });
    } catch (Exception e) {
      throw new SnapshotException("Failed to check if snapshot is available on " + path, e);
    }
    return isSnapAvlb.get();
  }
Checks whether a given snapshot exists or not.
@param dfs DistributedFileSystem.
@param path path of snapshot.
@param snapshotPrefix snapshot name prefix.
@param snapshotName name of snapshot.
@param conf Hive configuration.
@return true if the snapshot exists.
@throws IOException in case of any error.
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/SnapshotUtils.java