private static void deleteReplRelatedSnapshots(FileSystem fs, Path path) {
    try {
      DistributedFileSystem dfs = (DistributedFileSystem) fs;
      // List the snapshot directory.
      FileStatus[] listing = fs.listStatus(new Path(path, ".snapshot"));
      for (FileStatus elem : listing) {
        // if the snapshot name has replication related suffix, then delete that snapshot.
        if (elem.getPath().getName().endsWith("replOld") || elem.getPath().getName().endsWith("replNew")) {
          dfs.deleteSnapshot(path, elem.getPath().getName());
        }
      }
    } catch (Exception ioe) {
      // Ignore since this method is used as part of purge which actually ignores all exception, if the directory can
      // not be deleted, so preserve the same behaviour.
      LOG.warn("Couldn't clean up replication related snapshots", ioe);
    }
  }
Attempts to delete the replication related snapshots
@param fs the filesystem
@param path path where the snapshots are supposed to exists.
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/FileUtils.java