public static void createSnapshot(FileSystem fs, Path snapshotPath, String snapshotName, HiveConf conf)
      throws IOException {
    Retryable retryable = Retryable.builder().withHiveConf(conf).withRetryOnException(IOException.class)
        .withFailOnException(SnapshotException.class).build();
    try {
      retryable.executeCallable(() -> {
        try {
          fs.createSnapshot(snapshotPath, snapshotName);
        } catch (FileNotFoundException e) {
          LOG.warn("Couldn't create the snapshot {} under path {}", snapshotName, snapshotPath, e);
        }
        return null;
      });
    } catch (Exception e) {
      throw new SnapshotException(
          "Unable to create snapshot for path: " + snapshotPath + " snapshot name: " + snapshotName, e);
    }
  }
Attempts creating a snapshot, with retries.
@param fs FileSystem object.
@param snapshotPath Path of the snapshot.
@param snapshotName Name of the snapshot.
@param conf Hive Configuration.
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/SnapshotUtils.java