public boolean hasBackupSessions() throws IOException {
    LOG.trace("Has backup sessions from backup system table");

    boolean result = false;
    Scan scan = createScanForBackupHistory();
    scan.setCaching(1);
    try (Table table = connection.getTable(tableName);
      ResultScanner scanner = table.getScanner(scan)) {
      if (scanner.next() != null) {
        result = true;
      }
      return result;
    }
  }
Checks if we have at least one backup session in backup system table This API is used by
BackupLogCleaner
@return true, if - at least one session exists in backup system table table
@throws IOException exception
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java