void queryStorageUsageForHost(String clustername, String hostname, ContainerStorageStatsFunction func)
      throws SQLException {
    try (Connection connection = dataSource.getConnection()) {
      try (PreparedStatement queryStatement = connection.prepareStatement(querySqlForClusterAndHost)) {
        long startTimeMs = System.currentTimeMillis();
        queryStatement.setString(1, clustername);
        queryStatement.setString(2, hostname);
        try (ResultSet resultSet = queryStatement.executeQuery()) {
          while (resultSet.next()) {
            int partitionId = resultSet.getInt(PARTITION_ID_COLUMN);
            int accountId = resultSet.getInt(ACCOUNT_ID_COLUMN);
            int containerId = resultSet.getInt(CONTAINER_ID_COLUMN);
            long storageUsage = resultSet.getLong(STORAGE_USAGE_COLUMN);
            final long physicalStorageUsage = resultSet.getLong(PHYSICAL_STORAGE_USAGE_COLUMN);
            final long numberOfBlobs = resultSet.getLong(NUMBER_OF_BLOBS_COLUMN);
            long updatedAtMs = resultSet.getTimestamp(UPDATED_AT_COLUMN).getTime();
            func.apply(partitionId, (short) accountId,
                new ContainerStorageStats((short) containerId, storageUsage, physicalStorageUsage, numberOfBlobs),
                updatedAtMs);
          }
        }
        metrics.readTimeMs.update(System.currentTimeMillis() - startTimeMs);
        metrics.readSuccessCount.inc();
      }
    } catch (SQLException e) {
      metrics.readFailureCount.inc();
      logger.error(
          String.format("Failed to execute query on %s, with parameter %s %s", ACCOUNT_REPORTS_TABLE, clustername,
              hostname), e);
      throw e;
    }
  }
Query container storage usage for given {@code clustername} and {@code hostname}. The result will be applied to the
{@link ContainerStorageStatsFunction}.
@param clustername The clustername.
@param hostname The hostname.
@param func The {@link ContainerStorageStatsFunction} to call to process each container storage usage.
@throws SQLException
ambry-mysql/src/main/java/com/github/ambry/accountstats/AccountReportsDao.java