public List<BackupInfo> getBackupHistory(int n, BackupInfo.Filter... filters) throws IOException {
    if (filters.length == 0) {
      return getHistory(n);
    }

    List<BackupInfo> history = getBackupHistory();
    List<BackupInfo> result = new ArrayList<>();
    for (BackupInfo bi : history) {
      if (n >= 0 && result.size() == n) {
        break;
      }

      boolean passed = true;
      for (int i = 0; i < filters.length; i++) {
        if (!filters[i].apply(bi)) {
          passed = false;
          break;
        }
      }
      if (passed) {
        result.add(bi);
      }
    }
    return result;
  }
Get backup history records filtered by list of filters.
@param n       max number of records, if n == -1 , then max number is ignored
@param filters list of filters
@return backup records
@throws IOException if getting the backup history fails
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java