public HikariDataSource buildDataSource(MySqlUtils.DbEndpoint dbEndpoint) {
    HikariConfig hikariConfig = new HikariConfig();
    hikariConfig.setJdbcUrl(dbEndpoint.getUrl());
    hikariConfig.setUsername(dbEndpoint.getUsername());
    hikariConfig.setPassword(dbEndpoint.getPassword());
    hikariConfig.setMaximumPoolSize(config.localPoolSize);
    // 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.setMetricRegistry(metrics);
    return new HikariDataSource(hikariConfig);
  }
@param dbEndpoint struct containing JDBC connection information.
@return the {@link HikariDataSource} for the {@link MySqlUtils.DbEndpoint}.
ambry-mysql/src/main/java/com/github/ambry/repair/MysqlRepairRequestsDbFactory.java