private HikariDataSource buildDataSource(DbEndpoint dbEndpoint) {
    HikariConfig hikariConfig = new HikariConfig();
    hikariConfig.setJdbcUrl(dbEndpoint.getUrl());
    hikariConfig.setUsername(dbEndpoint.getUsername());
    hikariConfig.setPassword(dbEndpoint.getPassword());
    hikariConfig.setMaximumPoolSize(accountStatsMySqlConfig.poolSize);
    hikariConfig.setMinimumIdle(0);
    hikariConfig.setIdleTimeout(accountStatsMySqlConfig.connectionIdleTimeoutMs);
    // Recommended properties for automatic prepared statement caching
    // https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration
    hikariConfig.addDataSourceProperty("cachePrepStmts", "true");
    hikariConfig.addDataSourceProperty("prepStmtCacheSize", "250");
    hikariConfig.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
    hikariConfig.addDataSourceProperty("useServerPrepStmts", "true");
    hikariConfig.addDataSourceProperty(REWRITE_BATCHED_STATEMENTS_LITERAL,
        String.valueOf(accountStatsMySqlConfig.enableRewriteBatchedStatement));
    hikariConfig.setMetricRegistry(registry);
    return new HikariDataSource(hikariConfig);
  }
Return {@link AccountStatsMySqlStore}.
@return
@throws SQLException
ambry-mysql/src/main/java/com/github/ambry/accountstats/AccountStatsMySqlStoreFactory.java