public static void allowSnapshot(DistributedFileSystem dfs, Path snapshotPath, HiveConf conf) throws IOException {
    // Check if the directory is already snapshottable.
    Retryable retryable = Retryable.builder().withHiveConf(conf).withRetryOnException(IOException.class)
        .withFailOnException(SnapshotException.class).build();
    try {
      retryable.executeCallable(() -> {
        try {
          if (!dfs.getFileStatus(snapshotPath).isSnapshotEnabled()) {
            dfs.allowSnapshot(snapshotPath);
          }
        } catch (FileNotFoundException fnf) {
          // Source got deleted, we can ignore.
          LOG.info("Failed to allow snapshot for {} since the path got deleted", snapshotPath);
        }
        return null;
      });
    } catch (Exception e) {
      throw new SnapshotException("Failed to AllowSnapshot on " + snapshotPath, e);
    }
  }
Attempts to allow snapshots on the path, with retry.
@param dfs DistributedFileSystem.
@param snapshotPath path of snapshot.
@param conf Hive Configuration.
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/SnapshotUtils.java