Optional<Integer> coreConnections = getInputCoreConnections(conf);
Optional<Integer> maxConnections = getInputMaxConnections(conf);
Optional<Integer> maxSimultaneousRequests = getInputMaxSimultReqPerConnections(conf);
Optional<Integer> minSimultaneousRequests = getInputMinSimultReqPerConnections(conf);
PoolingOptions poolingOptions = new PoolingOptions();
if (coreConnections.isPresent())
poolingOptions.setCoreConnectionsPerHost(HostDistance.LOCAL, coreConnections.get());
if (maxConnections.isPresent())
poolingOptions.setMaxConnectionsPerHost(HostDistance.LOCAL, maxConnections.get());
if (minSimultaneousRequests.isPresent())
poolingOptions.setMinSimultaneousRequestsPerConnectionThreshold(HostDistance.LOCAL, minSimultaneousRequests.get());
if (maxSimultaneousRequests.isPresent())
poolingOptions.setMaxSimultaneousRequestsPerConnectionThreshold(HostDistance.LOCAL, maxSimultaneousRequests.get());
poolingOptions.setCoreConnectionsPerHost(HostDistance.REMOTE, 0)
.setMaxConnectionsPerHost(HostDistance.REMOTE, 0)
.setMinSimultaneousRequestsPerConnectionThreshold(HostDistance.REMOTE, 0)
.setMaxSimultaneousRequestsPerConnectionThreshold(HostDistance.REMOTE, 0);
return poolingOptions;