Skip to content
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

prepare 0.4.1 release #1249

Merged
merged 1 commit into from
Feb 19, 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
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

env:
CHC_BRANCH: "main"
CHC_VERSION: "0.4.1"
CHC_VERSION: "0.4.2"

jobs:
nightly:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
version:
description: "Release version"
required: true
default: "0.4.1-SNAPSHOT"
default: "0.4.2-SNAPSHOT"

jobs:
release:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.jar
*.war
*.ear
*.out

# VSCode
.bloop
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The library can be downloaded from both [Github Releases](../../releases) and [M
<groupId>com.clickhouse</groupId>
<!-- or clickhouse-grpc-client if you prefer gRPC -->
<artifactId>clickhouse-http-client</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
```

Expand Down Expand Up @@ -105,15 +105,9 @@ try (ClickHouseClient client = ClickHouseClient.newInstance(ClickHouseProtocol.H
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<!-- use uber jar with all dependencies included, change classifier to http for smaller jar -->
<classifier>all</classifier>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
```

Expand Down
15 changes: 15 additions & 0 deletions clickhouse-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand All @@ -161,10 +165,21 @@
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
<filters>
<filter>
<artifact>cc.blynk.clickhouse:clickhouse4j</artifact>
<excludes>
<exclude>net/**</exclude>
<exclude>org/**</exclude>
</excludes>
</filter>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>**/maven</exclude>
<exclude>**/module-info.class</exclude>
<exclude>**/DEPENDENCIES*</exclude>
<exclude>**/LICENSE*</exclude>
<exclude>**/NOTICE*</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
Expand Down
2 changes: 1 addition & 1 deletion clickhouse-cli-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Either [clickhouse](https://clickhouse.com/docs/en/interfaces/cli/) or [docker](
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-cli-client</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion clickhouse-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ client.connect("http://localhost/system")
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-http-client</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ static CompletableFuture<ClickHouseResponseSummary> dump(ClickHouseNode server,

return submit(() -> {
try (ClickHouseClient client = newInstance(theServer.getProtocol())) {
ClickHouseRequest<?> request = client.connect(theServer).output(stream);
ClickHouseRequest<?> request = client.read(theServer).output(stream);
// FIXME what if the table name is `try me`?
if (theQuery.indexOf(' ') < 0) {
request.table(theQuery);
Expand Down Expand Up @@ -415,7 +415,7 @@ static CompletableFuture<ClickHouseResponseSummary> dump(ClickHouseNode server,

return submit(() -> {
try (ClickHouseClient client = newInstance(theServer.getProtocol())) {
ClickHouseRequest<?> request = client.connect(theServer).compressServerResponse(compression)
ClickHouseRequest<?> request = client.read(theServer).compressServerResponse(compression)
.format(format).output(output);
// FIXME what if the table name is `try me`?
if (theQuery.indexOf(' ') < 0) {
Expand Down Expand Up @@ -485,7 +485,7 @@ static CompletableFuture<ClickHouseResponseSummary> load(ClickHouseNode server,

return submit(() -> {
try (ClickHouseClient client = newInstance(theServer.getProtocol());
ClickHouseResponse response = client.connect(theServer).write().table(table).data(stream)
ClickHouseResponse response = client.write(theServer).table(table).data(stream)
.executeAndWait()) {
return response.getSummary();
}
Expand Down Expand Up @@ -516,7 +516,7 @@ static CompletableFuture<ClickHouseResponseSummary> load(ClickHouseNode server,

return submit(() -> {
try (ClickHouseClient client = newInstance(theServer.getProtocol());
ClickHouseResponse response = client.connect(theServer).write().table(table).data(writer)
ClickHouseResponse response = client.write(theServer).table(table).data(writer)
.decompressClientRequest(compression).format(format).executeAndWait()) {
return response.getSummary();
}
Expand Down Expand Up @@ -611,7 +611,7 @@ static CompletableFuture<ClickHouseResponseSummary> load(ClickHouseNode server,

return submit(() -> {
try (ClickHouseClient client = newInstance(theServer.getProtocol());
ClickHouseResponse response = client.connect(theServer).write().table(table).data(input)
ClickHouseResponse response = client.write(theServer).table(table).data(input)
.decompressClientRequest(compression).format(format).executeAndWait()) {
return response.getSummary();
} finally {
Expand Down Expand Up @@ -697,7 +697,7 @@ static CompletableFuture<List<ClickHouseResponseSummary>> send(ClickHouseNode se
try (ClickHouseClient client = ClickHouseClient.builder()
.nodeSelector(ClickHouseNodeSelector.of(theServer.getProtocol()))
.option(ClickHouseClientOption.ASYNC, false).build()) {
ClickHouseRequest<?> request = client.connect(theServer).format(ClickHouseFormat.RowBinary);
ClickHouseRequest<?> request = client.read(theServer).format(ClickHouseFormat.RowBinary);
if ((boolean) ClickHouseDefaults.AUTO_SESSION.getEffectiveDefaultValue() && queries.size() > 1) {
request.session(request.getManager().createSessionId(), false);
}
Expand Down Expand Up @@ -736,7 +736,7 @@ static CompletableFuture<ClickHouseResponseSummary> send(ClickHouseNode server,
try (ClickHouseClient client = ClickHouseClient.builder()
.nodeSelector(ClickHouseNodeSelector.of(theServer.getProtocol()))
.option(ClickHouseClientOption.ASYNC, false).build();
ClickHouseResponse resp = client.connect(theServer).format(ClickHouseFormat.RowBinary).query(sql)
ClickHouseResponse resp = client.read(theServer).format(ClickHouseFormat.RowBinary).query(sql)
.params(params).executeAndWait()) {
return resp.getSummary();
}
Expand Down Expand Up @@ -806,7 +806,7 @@ static CompletableFuture<List<ClickHouseResponseSummary>> send(ClickHouseNode se
.nodeSelector(ClickHouseNodeSelector.of(theServer.getProtocol()))
.option(ClickHouseClientOption.ASYNC, false).build()) {
// format doesn't matter here as we only need a summary
ClickHouseRequest<?> request = client.connect(theServer).format(ClickHouseFormat.RowBinary).query(sql);
ClickHouseRequest<?> request = client.read(theServer).format(ClickHouseFormat.RowBinary).query(sql);
for (int i = 0; i < size; i++) {
Object[] o = params[i];
String[] arr = new String[len];
Expand Down Expand Up @@ -859,7 +859,7 @@ static CompletableFuture<List<ClickHouseResponseSummary>> send(ClickHouseNode se
.nodeSelector(ClickHouseNodeSelector.of(theServer.getProtocol()))
.option(ClickHouseClientOption.ASYNC, false).build()) {
// format doesn't matter here as we only need a summary
ClickHouseRequest<?> request = client.connect(theServer).format(ClickHouseFormat.RowBinary);
ClickHouseRequest<?> request = client.read(theServer).format(ClickHouseFormat.RowBinary);
ClickHouseParameterizedQuery query = ClickHouseParameterizedQuery.of(request.getConfig(), sql);
StringBuilder builder = new StringBuilder();
for (String[] p : params) {
Expand Down Expand Up @@ -1093,7 +1093,7 @@ default boolean ping(ClickHouseNode server, int timeout) {
if (server.getProtocol() == ClickHouseProtocol.ANY) {
server = ClickHouseNode.probe(server.getHost(), server.getPort(), timeout);
}
try (ClickHouseResponse resp = connect(server) // create request
try (ClickHouseResponse resp = read(server) // create request
.option(ClickHouseClientOption.ASYNC, false) // use current thread
.option(ClickHouseClientOption.CONNECTION_TIMEOUT, timeout)
.option(ClickHouseClientOption.SOCKET_TIMEOUT, timeout)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ public void testBuildInOneGo() {
checkCustomValues(node, "", host, port, 1, protocol, database, null, new String[] { "read-only", "primary" });
}

@Test(groups = { "unit" })
public void testCredentials() {
ClickHouseNode node = ClickHouseNode.builder().build();
Assert.assertEquals(node.getCredentials().orElse(null), null);

ClickHouseCredentials credentials = ClickHouseCredentials.fromUserAndPassword("default", "password");
node = ClickHouseNode.builder().credentials(credentials).build();
Assert.assertEquals(node.getCredentials().orElse(null), credentials);
Assert.assertTrue(node.getCredentials().orElse(null) == credentials, "Should be the exact same instance");
}

@Test(groups = { "unit" })
public void testDatabase() {
ClickHouseConfig config = new ClickHouseConfig(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,8 @@ public void testCustomWriter() throws ClickHouseException {

try (ClickHouseResponse resp = req.data(w).executeAndWait()) {
Assert.assertNotNull(resp);
} catch (Exception e) {
Assert.fail("Failed to call executeAndWait(): async=" + b, e);
}
Assert.assertTrue(req.getInputStream().get().isClosed(), "Input stream should have been closed");
}
Expand Down
2 changes: 1 addition & 1 deletion clickhouse-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-data</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
```

Expand Down
8 changes: 1 addition & 7 deletions clickhouse-jdbc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@ Keep in mind that `clickhouse-jdbc` is synchronous, and in general it has more o
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<!-- use uber jar with all dependencies included, change classifier to http for smaller jar -->
<classifier>all</classifier>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion clickhouse-r2dbc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<groupId>com.clickhouse</groupId>
<!-- change to clickhouse-r2dbc_0.9.1 for SPI 0.9.1.RELEASE -->
<artifactId>clickhouse-r2dbc</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<!-- use uber jar with all dependencies included, change classifier to http or grpc for smaller jar -->
<classifier>all</classifier>
<exclusions>
Expand Down
16 changes: 10 additions & 6 deletions examples/grpc/pom.xml → examples/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.clickhouse</groupId>
<artifactId>grpc-examples</artifactId>
<artifactId>java-client-examples</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<name>grpc-examples</name>
<description>gRPC Examples</description>
<name>java-client-examples</name>
<description>Java Client Examples</description>
<url>https://github.com/ClickHouse/clickhouse-java</url>
<inceptionYear>2022</inceptionYear>

Expand Down Expand Up @@ -66,7 +66,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<clickhouse-grpc.version>0.4.0</clickhouse-grpc.version>
<clickhouse-java.version>0.4.1</clickhouse-java.version>

<compiler-plugin.version>3.8.1</compiler-plugin.version>

Expand All @@ -76,8 +76,12 @@
<dependencies>
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-grpc-client</artifactId>
<version>${clickhouse-grpc.version}</version>
<!--
change to clickhouse-cli-client for TCP
or clickhouse-grpc-client for gRPC
-->
<artifactId>clickhouse-http-client</artifactId>
<version>${clickhouse-java.version}</version>
<classifier>shaded</classifier>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,15 @@ static int query(ClickHouseNode server, String table) throws ClickHouseException

public static void main(String[] args) {
ClickHouseNode server = ClickHouseNode.builder()
.host(System.getProperty("chHost", "127.0.0.1"))
.port(ClickHouseProtocol.GRPC, Integer.parseInt(System.getProperty("chPort", "9100")))
.host(System.getProperty("chHost", "localhost"))
.port(ClickHouseProtocol.HTTP, Integer.getInteger("chPort", 8123))
// .port(ClickHouseProtocol.GRPC, Integer.getInteger("chPort", 9000))
// .port(ClickHouseProtocol.TCP, Integer.getInteger("chPort", 9100))
.database("system").credentials(ClickHouseCredentials.fromUserAndPassword(
System.getProperty("chUser", "default"), System.getProperty("chPassword", "")))
.build();

String table = "grpc_example_table";
String table = "java_client_example_table";

try {
dropAndCreateTable(server, table);
Expand Down
10 changes: 2 additions & 8 deletions examples/jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<clickhouse-jdbc.version>0.4.0</clickhouse-jdbc.version>
<clickhouse-java.version>0.4.1</clickhouse-java.version>
<hikaricp.version>4.0.3</hikaricp.version>

<compiler-plugin.version>3.8.1</compiler-plugin.version>
Expand All @@ -78,14 +78,8 @@
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
<version>${clickhouse-jdbc.version}</version>
<version>${clickhouse-java.version}</version>
<classifier>http</classifier>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-r2dbc</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</distributionManagement>

<properties>
<revision>0.4.1-SNAPSHOT</revision>
<revision>0.4.2-SNAPSHOT</revision>
<project.current.year>2023</project.current.year>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand Down Expand Up @@ -157,7 +157,7 @@
<sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
<sonar.organization>zhicwu</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.projectVersion>0.4.0</sonar.projectVersion>
<sonar.projectVersion>0.4.1</sonar.projectVersion>
<sonar.cpd.exclusions>**/*0*.java,**/data/*Value.java,**/data/array/*Value.java,**/stream/*Stream.java</sonar.cpd.exclusions>
</properties>

Expand Down