static List<Delete> createDeletesForExistingSnapshotsFromScan(Connection connection, Scan scan)
    throws IOException {
    List<Delete> deletes = new ArrayList<>();
    try (Table quotaTable = connection.getTable(QUOTA_TABLE_NAME);
      ResultScanner rs = quotaTable.getScanner(scan)) {
      for (Result r : rs) {
        CellScanner cs = r.cellScanner();
        while (cs.advance()) {
          Cell c = cs.current();
          byte[] family = Bytes.copy(c.getFamilyArray(), c.getFamilyOffset(), c.getFamilyLength());
          byte[] qual =
            Bytes.copy(c.getQualifierArray(), c.getQualifierOffset(), c.getQualifierLength());
          Delete d = new Delete(r.getRow());
          d.addColumns(family, qual);
          deletes.add(d);
        }
      }
      return deletes;
    }
  }
Returns a list of {@code Delete} to remove all entries returned by the passed scanner.
@param connection connection to re-use
@param scan       the scanner to use to generate the list of deletes
hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java