Map<String, Short> queryPartitionClassNames(String clusterName) throws SQLException {
    Map<String, Short> result = new HashMap<>();
    try (Connection connection = dataSource.getConnection()) {
      try (PreparedStatement queryStatement = connection.prepareStatement(queryPartitionClassNamesSql)) {
        long startTimeMs = System.currentTimeMillis();
        queryStatement.setString(1, clusterName);
        try (ResultSet rs = queryStatement.executeQuery()) {
          while (rs.next()) {
            short partitionClassId = rs.getShort(ID_COLUMN);
            String partitionClassName = rs.getString(NAME_COLUMN);
            result.put(partitionClassName, partitionClassId);
          }
        }
        metrics.readTimeMs.update(System.currentTimeMillis() - startTimeMs);
        metrics.readSuccessCount.inc();
      }
      return result;
    } catch (SQLException e) {
      metrics.readFailureCount.inc();
      logger.error("Failed to execute query of {}, with parameter {}", queryPartitionClassNamesSql, clusterName, e);
      throw e;
    }
  }
Query partition class names and their corresponding id for given {@code clusterName}. An empty map will be returned
if there is not rows for the given {@code clusterName}.
@param clusterName The clusterName to query partition class names for
@return A map whose key is the partition class name and the value is the corresponding id.
@throws SQLException
ambry-mysql/src/main/java/com/github/ambry/accountstats/PartitionClassReportsDao.java