Set<Integer> queryPartitionIds(String clusterName) throws SQLException {
    Set<Integer> partitionIds = new HashSet<>();
    try (Connection connection = dataSource.getConnection()) {
      try (PreparedStatement queryStatement = connection.prepareStatement(queryPartitionIdsSql)) {
        long startTimeMs = System.currentTimeMillis();
        queryStatement.setString(1, clusterName);
        try (ResultSet rs = queryStatement.executeQuery()) {
          while (rs.next()) {
            partitionIds.add(rs.getInt(ID_COLUMN));
          }
        }
        metrics.readTimeMs.update(System.currentTimeMillis() - startTimeMs);
        metrics.readSuccessCount.inc();
      }
      return partitionIds;
    } catch (SQLException e) {
      metrics.readFailureCount.inc();
      logger.error("Failed to execute query {}, with parameter {}", queryPartitionIdsSql, clusterName, e);
      throw e;
    }
  }
Query the partition ids belonging to the given {@code clusterName}. An empty set will be returned if there is no
partitions for the given {@code clusterName}.
@param clusterName The clusterName.
@return A set of partition ids of the given {@code clusterName}.
@throws SQLException
ambry-mysql/src/main/java/com/github/ambry/accountstats/PartitionClassReportsDao.java