public static void renameSnapshot(FileSystem fs, Path snapshotPath, String sourceSnapshotName,
      String targetSnapshotName, HiveConf conf) throws IOException {
    Retryable retryable = Retryable.builder().withHiveConf(conf).withRetryOnException(IOException.class)
        .withFailOnException(SnapshotException.class).build();
    try {
      retryable.executeCallable(() -> {
        try {
          fs.renameSnapshot(snapshotPath, sourceSnapshotName, targetSnapshotName);
        } catch (FileNotFoundException e) {
          LOG.warn("Couldn't rename the snapshot {} to {} under path {}", sourceSnapshotName, targetSnapshotName,
              snapshotPath, e);
        }
        return null;
      });
    } catch (Exception e) {
      throw new SnapshotException(
          "Unable to rename snapshot " + sourceSnapshotName + " to " + targetSnapshotName + " for path: "
              + snapshotPath, e);
    }
  }
Renames a snapshot with retries.
@param fs the filesystem.
@param snapshotPath the path where the snapshot lies.
@param sourceSnapshotName current snapshot name.
@param targetSnapshotName new snapshot name.
@param conf configuration.
@throws IOException in case of failure.
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/SnapshotUtils.java