public static ArrayList corruptSnapshot(final HBaseTestingUtil util, final String snapshotName)
    throws IOException {
    final MasterFileSystem mfs = util.getHBaseCluster().getMaster().getMasterFileSystem();
    final FileSystem fs = mfs.getFileSystem();

    Path snapshotDir =
      SnapshotDescriptionUtils.getCompletedSnapshotDir(snapshotName, mfs.getRootDir());
    SnapshotProtos.SnapshotDescription snapshotDesc =
      SnapshotDescriptionUtils.readSnapshotInfo(fs, snapshotDir);
    final TableName table = TableName.valueOf(snapshotDesc.getTable());

    final ArrayList corruptedFiles = new ArrayList();
    final Configuration conf = util.getConfiguration();
    SnapshotReferenceUtil.visitTableStoreFiles(conf, fs, snapshotDir, snapshotDesc,
      new SnapshotReferenceUtil.StoreFileVisitor() {
        @Override
        public void storeFile(final RegionInfo regionInfo, final String family,
          final SnapshotRegionManifest.StoreFile storeFile) throws IOException {
          String region = regionInfo.getEncodedName();
          String hfile = storeFile.getName();
          HFileLink link = HFileLink.build(conf, table, region, family, hfile);
          if (corruptedFiles.size() % 2 == 0) {
            fs.delete(link.getAvailablePath(fs), true);
            corruptedFiles.add(hfile);
          }
        }
      });

    assertTrue(corruptedFiles.size() > 0);
    return corruptedFiles;
  }
Corrupt the specified snapshot by deleting some files.
@param util         {@link HBaseTestingUtil}
@param snapshotName name of the snapshot to corrupt
@return array of the corrupted HFiles
@throws IOException on unexecpted error reading the FS
hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java