Search in sources :

Example 1 with ConnectionException

use of in.zapr.druid.druidry.client.exception.ConnectionException in project druidry by zapr-oss.

the class DruidJerseyClient method connect.

@Override
public void connect() throws ConnectionException {
    try {
        if (jerseyConfig == null) {
            HttpClientConnectionManager connectionManager = createConnectionManager();
            this.jerseyConfig = new ClientConfig();
            this.jerseyConfig.property(ApacheClientProperties.CONNECTION_MANAGER, connectionManager);
            this.jerseyConfig.connectorProvider(new ApacheConnectorProvider());
        }
        this.client = ClientBuilder.newClient(this.jerseyConfig);
        this.queryWebTarget = this.client.target(this.druidUrl);
    } catch (Exception e) {
        throw new ConnectionException(e);
    }
}
Also used : ApacheConnectorProvider(org.glassfish.jersey.apache.connector.ApacheConnectorProvider) HttpClientConnectionManager(org.apache.http.conn.HttpClientConnectionManager) PoolingHttpClientConnectionManager(org.apache.http.impl.conn.PoolingHttpClientConnectionManager) ClientConfig(org.glassfish.jersey.client.ClientConfig) ConnectionException(in.zapr.druid.druidry.client.exception.ConnectionException) QueryException(in.zapr.druid.druidry.client.exception.QueryException) ConnectionException(in.zapr.druid.druidry.client.exception.ConnectionException)

Aggregations

ConnectionException (in.zapr.druid.druidry.client.exception.ConnectionException)1 QueryException (in.zapr.druid.druidry.client.exception.QueryException)1 HttpClientConnectionManager (org.apache.http.conn.HttpClientConnectionManager)1 PoolingHttpClientConnectionManager (org.apache.http.impl.conn.PoolingHttpClientConnectionManager)1 ApacheConnectorProvider (org.glassfish.jersey.apache.connector.ApacheConnectorProvider)1 ClientConfig (org.glassfish.jersey.client.ClientConfig)1