Skip to content
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
3 changes: 1 addition & 2 deletions clickhouse-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
</parent>

<artifactId>clickhouse-benchmark</artifactId>
<version>${revision}</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
<name>ClickHouse Client Benchmarks</name>
<description>Benchmarks for ClickHouse clients</description>
<url>https://github.com/ClickHouse/clickhouse-jdbc/tree/master/clickhouse-benchmark</url>

Expand Down
65 changes: 41 additions & 24 deletions clickhouse-cli-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,21 @@
</parent>

<artifactId>clickhouse-cli-client</artifactId>
<version>${revision}</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
<name>ClickHouse Native Command-line Wrapper</name>
<description>Wrapper of ClickHouse native command-line client</description>
<url>https://github.com/ClickHouse/clickhouse-jdbc/tree/master/clickhouse-cli-client</url>

<properties>
<shade.base>${project.parent.groupId}.client.internal</shade.base>
</properties>

<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>clickhouse-client</artifactId>
<version>${revision}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.lz4</groupId>
<artifactId>lz4-java</artifactId>
</dependency>

<!-- necessary for Java 9+ -->
Expand Down Expand Up @@ -65,6 +58,19 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<environmentVariables>
<CHC_TEST_CONTAINER_ID>clickhouse-cli-client</CHC_TEST_CONTAINER_ID>
</environmentVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand All @@ -77,13 +83,24 @@
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>shaded</shadedClassifierName>
<createDependencyReducedPom>true</createDependencyReducedPom>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<shadedClassifierName>shaded</shadedClassifierName>
<relocations>
<relocation>
<pattern>net.jpountz</pattern>
<shadedPattern>${shade.base}.jpountz</shadedPattern>
</relocation>
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Automatic-Module-Name>com.clickhouse.client.cli</Automatic-Module-Name>
</manifestEntries>
</transformer>
</transformers>
<filters>
<filter>
Expand All @@ -104,17 +121,17 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<environmentVariables>
<CHC_TEST_CONTAINER_ID>clickhouse-cli-client</CHC_TEST_CONTAINER_ID>
</environmentVariables>
</configuration>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<executions>
<execution>
<id>flatten</id>
<phase>package</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
3 changes: 1 addition & 2 deletions clickhouse-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
</parent>

<artifactId>clickhouse-client</artifactId>
<version>${revision}</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
<name>ClickHouse Java Client</name>
<description>Unified Java client for ClickHouse</description>
<url>https://github.com/ClickHouse/clickhouse-jdbc/tree/master/clickhouse-client</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ public abstract class ClickHouseInputStream extends InputStream {
* @param compressionLevel compression level
* @return non-null wrapped input stream
*/
static ClickHouseInputStream wrap(ClickHouseFile file, InputStream input, int bufferSize, Runnable postCloseAction,
ClickHouseCompression compression, int compressionLevel) {
public static ClickHouseInputStream wrap(ClickHouseFile file, InputStream input, int bufferSize,
Runnable postCloseAction, ClickHouseCompression compression, int compressionLevel) {
final ClickHouseInputStream chInput;
if (compression == null || compression == ClickHouseCompression.NONE) {
chInput = new WrappedInputStream(file, input, bufferSize, postCloseAction);
chInput = input != EmptyInputStream.INSTANCE && input instanceof ClickHouseInputStream
? (ClickHouseInputStream) input
: new WrappedInputStream(file, input, bufferSize, postCloseAction);
} else {
switch (compression) {
case GZIP:
Expand Down Expand Up @@ -485,7 +487,7 @@ public static File save(File file, InputStream in, int bufferSize, int timeout,
tmp = File.createTempFile("chc", "data");
tmp.deleteOnExit();
} catch (IOException e) {
throw new IllegalStateException("Failed to create temp file", e);
throw new UncheckedIOException("Failed to create temp file", e);
}
}
CompletableFuture<File> data = CompletableFuture.supplyAsync(() -> {
Expand All @@ -509,7 +511,9 @@ public static File save(File file, InputStream in, int bufferSize, int timeout,
} catch (ExecutionException e) {
Throwable cause = e.getCause();
if (cause instanceof UncheckedIOException) {
cause = ((UncheckedIOException) cause).getCause();
throw ((UncheckedIOException) cause);
} else if (cause instanceof IOException) {
throw new UncheckedIOException((IOException) cause);
}
throw new IllegalStateException(cause);
}
Expand Down
76 changes: 60 additions & 16 deletions clickhouse-grpc-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@
</parent>

<artifactId>clickhouse-grpc-client</artifactId>
<version>${revision}</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
<name>ClickHouse gRPC Client</name>
<description>gRPC client for ClickHouse</description>
<url>https://github.com/ClickHouse/clickhouse-jdbc/tree/master/clickhouse-grpc-client</url>

<properties>
<shade.base>${project.parent.groupId}.client.internal</shade.base>
</properties>

<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
Expand All @@ -35,20 +30,24 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.lz4</groupId>
<artifactId>lz4-java</artifactId>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</dependency>
<!-- necessary for Java 9+ -->
<dependency>
<groupId>org.apache.tomcat</groupId>
Expand Down Expand Up @@ -88,6 +87,10 @@
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand All @@ -100,9 +103,9 @@
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>shaded</shadedClassifierName>
<createDependencyReducedPom>true</createDependencyReducedPom>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<shadedClassifierName>shaded</shadedClassifierName>
<relocations>
<relocation>
<pattern>com.google</pattern>
Expand All @@ -116,6 +119,10 @@
<pattern>okio</pattern>
<shadedPattern>${shade.base}.okio</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache</pattern>
<shadedPattern>${shade.base}.apache</shadedPattern>
</relocation>
<relocation>
<pattern>io.grpc</pattern>
<shadedPattern>${shade.base}.grpc</shadedPattern>
Expand All @@ -128,11 +135,20 @@
<pattern>io.opencensus</pattern>
<shadedPattern>${shade.base}.opencensus</shadedPattern>
</relocation>
<relocation>
<pattern>net.jpountz</pattern>
<shadedPattern>${shade.base}.jpountz</shadedPattern>
</relocation>
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Automatic-Module-Name>com.clickhouse.client.grpc</Automatic-Module-Name>
</manifestEntries>
</transformer>
</transformers>
<filters>
<filter>
Expand All @@ -141,7 +157,8 @@
<exclude>android/**</exclude>
<exclude>google/**</exclude>
<exclude>javax/**</exclude>
<exclude>org/**</exclude>
<exclude>org/checkerframework/**</exclude>
<exclude>org/codehaus/**</exclude>
<exclude>**/module-info.class</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/maven/**</exclude>
Expand All @@ -167,6 +184,10 @@
<pattern>com.google</pattern>
<shadedPattern>${shade.base}.google</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache</pattern>
<shadedPattern>${shade.base}.apache</shadedPattern>
</relocation>
<relocation>
<pattern>io.grpc</pattern>
<shadedPattern>${shade.base}.grpc</shadedPattern>
Expand All @@ -179,6 +200,10 @@
<pattern>io.opencensus</pattern>
<shadedPattern>${shade.base}.opencensus</shadedPattern>
</relocation>
<relocation>
<pattern>net.jpountz</pattern>
<shadedPattern>${shade.base}.jpountz</shadedPattern>
</relocation>
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
Expand All @@ -195,7 +220,8 @@
<exclude>io/grpc/okhttp/**</exclude>
<exclude>javax/**</exclude>
<exclude>okio/**</exclude>
<exclude>org/**</exclude>
<exclude>org/checkerframework/**</exclude>
<exclude>org/codehaus/**</exclude>
<exclude>**/module-info.class</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/maven/**</exclude>
Expand Down Expand Up @@ -229,6 +255,10 @@
<pattern>okio</pattern>
<shadedPattern>${shade.base}.okio</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache</pattern>
<shadedPattern>${shade.base}.apache</shadedPattern>
</relocation>
<relocation>
<pattern>io.grpc</pattern>
<shadedPattern>${shade.base}.grpc</shadedPattern>
Expand All @@ -241,6 +271,10 @@
<pattern>io.opencensus</pattern>
<shadedPattern>${shade.base}.opencensus</shadedPattern>
</relocation>
<relocation>
<pattern>net.jpountz</pattern>
<shadedPattern>${shade.base}.jpountz</shadedPattern>
</relocation>
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
Expand All @@ -255,7 +289,8 @@
<exclude>google/**</exclude>
<exclude>io/grpc/netty/**</exclude>
<exclude>javax/**</exclude>
<exclude>org/**</exclude>
<exclude>org/checkerframework/**</exclude>
<exclude>org/codehaus/**</exclude>
<exclude>**/module-info.class</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/maven/**</exclude>
Expand Down Expand Up @@ -288,8 +323,17 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<executions>
<execution>
<id>flatten</id>
<phase>package</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
Expand Down
Loading