private Page<NamedBlobRecord> run_list_v2(String accountName, String containerName, String blobNamePrefix,
      String pageToken, short accountId, short containerId, Connection connection, Integer maxKeys) throws Exception {
    String query = "";
    String queryStatement = blobNamePrefix == null ? LIST_ALL_QUERY : LIST_WITH_PREFIX_SQL;
    int maxKeysValue = maxKeys == null ? config.listMaxResults : maxKeys;
    try (PreparedStatement statement = connection.prepareStatement(queryStatement)) {
      if (blobNamePrefix == null) {
        constructListAllQuery(statement, accountId, containerId, pageToken, maxKeysValue);
      } else {
        if (config.listNamedBlobsSQLOption == MySqlNamedBlobDbConfig.MIN_LIST_NAMED_BLOBS_SQL_OPTION) {
          constructListQueryWithPrefixV2(statement, accountId, containerId, blobNamePrefix, pageToken, maxKeysValue);
        } else {
          constructListQueryWithPrefixV3(statement, accountId, containerId, blobNamePrefix, pageToken, maxKeysValue);
        }
      }
      query = statement.toString();
      logger.debug("Getting list of blobs matching prefix {} from MySql. Query {}", blobNamePrefix, query);
      metricsRecoder.namedBlobListRate.mark();
      try (ResultSet resultSet = statement.executeQuery()) {
        String nextContinuationToken = null;
        List<NamedBlobRecord> entries = new ArrayList<>();
        int resultIndex = 0;
        while (resultSet.next()) {
          String blobName = resultSet.getString(1);
          if (resultIndex++ == maxKeysValue) {
            nextContinuationToken = blobName;
            break;
          }
          String blobId = Base64.encodeBase64URLSafeString(resultSet.getBytes(2));
          long version = resultSet.getLong(3);
          Timestamp deletionTime = resultSet.getTimestamp(4);
          long blobSize = resultSet.getLong(5);
          Timestamp modifiedTime = resultSet.getTimestamp(6);
          entries.add(
              new NamedBlobRecord(accountName, containerName, blobName, blobId, timestampToMs(deletionTime), version,
                  blobSize, timestampToMs(modifiedTime), false));
        }
        return new Page<>(entries, nextContinuationToken);
      }
    } catch (SQLException e) {
      logger.error("Failed to execute query {}, {}", query, e.getMessage());
      throw e;
    }
  }
Exposed for integration test usage.
@return a map from datacenter name to {@link DataSource}.
ambry-named-mysql/src/main/java/com/github/ambry/named/MySqlNamedBlobDb.java