Skip to content

Commit

Permalink
removed connection pool configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-kravtsov committed Nov 3, 2017
1 parent 0fbba7a commit 02b75bf
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions atsd/src/main/java/com/yahoo/ycsb/db/ATSDClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

/**
* ATSD client for YCSB framework.
*
* @author Michael Zimmermann
*/
public class ATSDClient extends DB {
private final int SUCCESS = 0;
Expand Down Expand Up @@ -101,9 +99,6 @@ private static HttpClientManager createHttpClientManager(String ip, int httpPort
ClientConfiguration clientConfiguration = configurationFactory.createClientConfiguration();
System.out.println("Connecting to ATSD: " + clientConfiguration.getMetadataUrl());
HttpClientManager httpClientManager = new HttpClientManager(clientConfiguration);

GenericObjectPoolConfig objectPoolConfig = createObjectPoolConfig();
httpClientManager.setObjectPoolConfig(objectPoolConfig);
httpClientManager.setBorrowMaxWaitMillis(1000);

return httpClientManager;
Expand All @@ -113,23 +108,13 @@ private static TcpClientManager createTcpClientManager(String ip, int tcpPort) {
TcpClientConfigurationFactory tcpConfigurationFactory =
new TcpClientConfigurationFactory(ip, tcpPort, false, 3000, 10000);
TcpClientConfiguration tcpClientConfiguration = tcpConfigurationFactory.createClientConfiguration();
TcpClientManager tcpClientManager = new TcpClientManager(tcpClientConfiguration);

GenericObjectPoolConfig objectPoolConfig = createObjectPoolConfig();
tcpClientManager.setObjectPoolConfig(objectPoolConfig);
TcpClientManager tcpClientManager = new TcpClientManager();
tcpClientManager.setClientConfiguration(tcpClientConfiguration);
tcpClientManager.setBorrowMaxWaitMillis(1000);

return tcpClientManager;
}

private static GenericObjectPoolConfig createObjectPoolConfig() {
GenericObjectPoolConfig objectPoolConfig = new GenericObjectPoolConfig();
objectPoolConfig.setMaxTotal(5);
objectPoolConfig.setMaxIdle(5);

return objectPoolConfig;
}

public void cleanup() throws DBException {
httpClientManager.close();
tcpClientManager.close();
Expand Down

0 comments on commit 02b75bf

Please sign in to comment.