Skip to content

Fix shaded issue #1335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
import com.clickhouse.client.ClickHouseRequest;
import com.clickhouse.client.http.config.ClickHouseHttpOption;
import com.clickhouse.client.http.config.HttpConnectionProvider;
import com.clickhouse.logging.Logger;
import com.clickhouse.logging.LoggerFactory;

public final class ClickHouseHttpConnectionFactory {
private static final Logger log = LoggerFactory.getLogger(ClickHouseHttpConnectionFactory.class);

public static ClickHouseHttpConnection createConnection(ClickHouseNode server, ClickHouseRequest<?> request,
ExecutorService executor) throws IOException {
HttpConnectionProvider provider = request.getConfig().getOption(ClickHouseHttpOption.CONNECTION_PROVIDER,
Expand All @@ -21,6 +25,7 @@ public static ClickHouseHttpConnection createConnection(ClickHouseNode server, C
} catch (IOException e) {
throw e;
} catch (Throwable t) {
log.warn("Error when creating http client %s, will use HTTP_URL_CONNECTION", provider.name(), t);
return new HttpUrlConnectionImpl(server, request, executor);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
import com.clickhouse.client.ClickHouseRequest;
import com.clickhouse.client.http.config.ClickHouseHttpOption;
import com.clickhouse.client.http.config.HttpConnectionProvider;
import com.clickhouse.logging.Logger;
import com.clickhouse.logging.LoggerFactory;

public final class ClickHouseHttpConnectionFactory {
private static final Logger log = LoggerFactory.getLogger(ClickHouseHttpConnectionFactory.class);

public static ClickHouseHttpConnection createConnection(ClickHouseNode server, ClickHouseRequest<?> request,
ExecutorService executor) throws IOException {
HttpConnectionProvider provider = request.getConfig().getOption(ClickHouseHttpOption.CONNECTION_PROVIDER,
Expand All @@ -23,6 +27,7 @@ public static ClickHouseHttpConnection createConnection(ClickHouseNode server, C
} catch (IOException e) {
throw e;
} catch (Throwable t) {
log.warn("Error when creating http client %s, will use HTTP_URL_CONNECTION", provider.name(), t);
return new HttpUrlConnectionImpl(server, request, executor);
}
}
Expand Down
2 changes: 2 additions & 0 deletions clickhouse-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@
<include>com.clickhouse:clickhouse-http-client</include>
<include>org.apache.httpcomponents.client5:httpclient5</include>
<include>org.apache.httpcomponents.core5:httpcore5</include>
<include>org.apache.httpcomponents.core5:httpcore5-h2</include>
<include>org.lz4:lz4-pure-java</include>
</includes>
</artifactSet>
Expand Down Expand Up @@ -486,6 +487,7 @@
<include>org.apache.commons:commons-compress</include>
<include>org.apache.httpcomponents.client5:httpclient5</include>
<include>org.apache.httpcomponents.core5:httpcore5</include>
<include>org.apache.httpcomponents.core5:httpcore5-h2</include>
<include>org.lz4:lz4-pure-java</include>
</includes>
</artifactSet>
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@
<artifactId>httpcore5</artifactId>
<version>${apache.httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.core5</groupId>
<artifactId>httpcore5-h2</artifactId>
<version>${apache.httpclient.version}</version>
</dependency>

<dependency>
<groupId>org.mariadb.jdbc</groupId>
Expand Down