Skip to content

Commit 4a6940b

Browse files
authored
Merge pull request #1249 from zhicwu/main
prepare 0.4.1 release
2 parents 9a987a1 + 38c0f56 commit 4a6940b

File tree

18 files changed

+68
-51
lines changed

18 files changed

+68
-51
lines changed

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
env:
1414
CHC_BRANCH: "main"
15-
CHC_VERSION: "0.4.1"
15+
CHC_VERSION: "0.4.2"
1616

1717
jobs:
1818
nightly:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
version:
77
description: "Release version"
88
required: true
9-
default: "0.4.1-SNAPSHOT"
9+
default: "0.4.2-SNAPSHOT"
1010

1111
jobs:
1212
release:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*.jar
88
*.war
99
*.ear
10+
*.out
1011

1112
# VSCode
1213
.bloop

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The library can be downloaded from both [Github Releases](../../releases) and [M
6969
<groupId>com.clickhouse</groupId>
7070
<!-- or clickhouse-grpc-client if you prefer gRPC -->
7171
<artifactId>clickhouse-http-client</artifactId>
72-
<version>0.4.0</version>
72+
<version>0.4.1</version>
7373
</dependency>
7474
```
7575

@@ -105,15 +105,9 @@ try (ClickHouseClient client = ClickHouseClient.newInstance(ClickHouseProtocol.H
105105
<dependency>
106106
<groupId>com.clickhouse</groupId>
107107
<artifactId>clickhouse-jdbc</artifactId>
108-
<version>0.4.0</version>
108+
<version>0.4.1</version>
109109
<!-- use uber jar with all dependencies included, change classifier to http for smaller jar -->
110110
<classifier>all</classifier>
111-
<exclusions>
112-
<exclusion>
113-
<groupId>*</groupId>
114-
<artifactId>*</artifactId>
115-
</exclusion>
116-
</exclusions>
117111
</dependency>
118112
```
119113

clickhouse-benchmark/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@
141141

142142
<build>
143143
<plugins>
144+
<plugin>
145+
<groupId>org.apache.maven.plugins</groupId>
146+
<artifactId>maven-javadoc-plugin</artifactId>
147+
</plugin>
144148
<plugin>
145149
<groupId>org.apache.maven.plugins</groupId>
146150
<artifactId>maven-shade-plugin</artifactId>
@@ -161,10 +165,21 @@
161165
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
162166
</transformers>
163167
<filters>
168+
<filter>
169+
<artifact>cc.blynk.clickhouse:clickhouse4j</artifact>
170+
<excludes>
171+
<exclude>net/**</exclude>
172+
<exclude>org/**</exclude>
173+
</excludes>
174+
</filter>
164175
<filter>
165176
<artifact>*:*</artifact>
166177
<excludes>
178+
<exclude>**/maven</exclude>
167179
<exclude>**/module-info.class</exclude>
180+
<exclude>**/DEPENDENCIES*</exclude>
181+
<exclude>**/LICENSE*</exclude>
182+
<exclude>**/NOTICE*</exclude>
168183
<exclude>META-INF/MANIFEST.MF</exclude>
169184
<exclude>META-INF/*.SF</exclude>
170185
<exclude>META-INF/*.DSA</exclude>

clickhouse-cli-client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Either [clickhouse](https://clickhouse.com/docs/en/interfaces/cli/) or [docker](
2020
<dependency>
2121
<groupId>com.clickhouse</groupId>
2222
<artifactId>clickhouse-cli-client</artifactId>
23-
<version>0.4.0</version>
23+
<version>0.4.1</version>
2424
</dependency>
2525
```
2626

clickhouse-client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ client.connect("http://localhost/system")
3838
<dependency>
3939
<groupId>com.clickhouse</groupId>
4040
<artifactId>clickhouse-http-client</artifactId>
41-
<version>0.4.0</version>
41+
<version>0.4.1</version>
4242
</dependency>
4343
```
4444

clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseClient.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ static CompletableFuture<ClickHouseResponseSummary> dump(ClickHouseNode server,
329329

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

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

486486
return submit(() -> {
487487
try (ClickHouseClient client = newInstance(theServer.getProtocol());
488-
ClickHouseResponse response = client.connect(theServer).write().table(table).data(stream)
488+
ClickHouseResponse response = client.write(theServer).table(table).data(stream)
489489
.executeAndWait()) {
490490
return response.getSummary();
491491
}
@@ -516,7 +516,7 @@ static CompletableFuture<ClickHouseResponseSummary> load(ClickHouseNode server,
516516

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

612612
return submit(() -> {
613613
try (ClickHouseClient client = newInstance(theServer.getProtocol());
614-
ClickHouseResponse response = client.connect(theServer).write().table(table).data(input)
614+
ClickHouseResponse response = client.write(theServer).table(table).data(input)
615615
.decompressClientRequest(compression).format(format).executeAndWait()) {
616616
return response.getSummary();
617617
} finally {
@@ -697,7 +697,7 @@ static CompletableFuture<List<ClickHouseResponseSummary>> send(ClickHouseNode se
697697
try (ClickHouseClient client = ClickHouseClient.builder()
698698
.nodeSelector(ClickHouseNodeSelector.of(theServer.getProtocol()))
699699
.option(ClickHouseClientOption.ASYNC, false).build()) {
700-
ClickHouseRequest<?> request = client.connect(theServer).format(ClickHouseFormat.RowBinary);
700+
ClickHouseRequest<?> request = client.read(theServer).format(ClickHouseFormat.RowBinary);
701701
if ((boolean) ClickHouseDefaults.AUTO_SESSION.getEffectiveDefaultValue() && queries.size() > 1) {
702702
request.session(request.getManager().createSessionId(), false);
703703
}
@@ -736,7 +736,7 @@ static CompletableFuture<ClickHouseResponseSummary> send(ClickHouseNode server,
736736
try (ClickHouseClient client = ClickHouseClient.builder()
737737
.nodeSelector(ClickHouseNodeSelector.of(theServer.getProtocol()))
738738
.option(ClickHouseClientOption.ASYNC, false).build();
739-
ClickHouseResponse resp = client.connect(theServer).format(ClickHouseFormat.RowBinary).query(sql)
739+
ClickHouseResponse resp = client.read(theServer).format(ClickHouseFormat.RowBinary).query(sql)
740740
.params(params).executeAndWait()) {
741741
return resp.getSummary();
742742
}
@@ -806,7 +806,7 @@ static CompletableFuture<List<ClickHouseResponseSummary>> send(ClickHouseNode se
806806
.nodeSelector(ClickHouseNodeSelector.of(theServer.getProtocol()))
807807
.option(ClickHouseClientOption.ASYNC, false).build()) {
808808
// format doesn't matter here as we only need a summary
809-
ClickHouseRequest<?> request = client.connect(theServer).format(ClickHouseFormat.RowBinary).query(sql);
809+
ClickHouseRequest<?> request = client.read(theServer).format(ClickHouseFormat.RowBinary).query(sql);
810810
for (int i = 0; i < size; i++) {
811811
Object[] o = params[i];
812812
String[] arr = new String[len];
@@ -859,7 +859,7 @@ static CompletableFuture<List<ClickHouseResponseSummary>> send(ClickHouseNode se
859859
.nodeSelector(ClickHouseNodeSelector.of(theServer.getProtocol()))
860860
.option(ClickHouseClientOption.ASYNC, false).build()) {
861861
// format doesn't matter here as we only need a summary
862-
ClickHouseRequest<?> request = client.connect(theServer).format(ClickHouseFormat.RowBinary);
862+
ClickHouseRequest<?> request = client.read(theServer).format(ClickHouseFormat.RowBinary);
863863
ClickHouseParameterizedQuery query = ClickHouseParameterizedQuery.of(request.getConfig(), sql);
864864
StringBuilder builder = new StringBuilder();
865865
for (String[] p : params) {
@@ -1093,7 +1093,7 @@ default boolean ping(ClickHouseNode server, int timeout) {
10931093
if (server.getProtocol() == ClickHouseProtocol.ANY) {
10941094
server = ClickHouseNode.probe(server.getHost(), server.getPort(), timeout);
10951095
}
1096-
try (ClickHouseResponse resp = connect(server) // create request
1096+
try (ClickHouseResponse resp = read(server) // create request
10971097
.option(ClickHouseClientOption.ASYNC, false) // use current thread
10981098
.option(ClickHouseClientOption.CONNECTION_TIMEOUT, timeout)
10991099
.option(ClickHouseClientOption.SOCKET_TIMEOUT, timeout)

clickhouse-client/src/test/java/com/clickhouse/client/ClickHouseNodeTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ public void testBuildInOneGo() {
107107
checkCustomValues(node, "", host, port, 1, protocol, database, null, new String[] { "read-only", "primary" });
108108
}
109109

110+
@Test(groups = { "unit" })
111+
public void testCredentials() {
112+
ClickHouseNode node = ClickHouseNode.builder().build();
113+
Assert.assertEquals(node.getCredentials().orElse(null), null);
114+
115+
ClickHouseCredentials credentials = ClickHouseCredentials.fromUserAndPassword("default", "password");
116+
node = ClickHouseNode.builder().credentials(credentials).build();
117+
Assert.assertEquals(node.getCredentials().orElse(null), credentials);
118+
Assert.assertTrue(node.getCredentials().orElse(null) == credentials, "Should be the exact same instance");
119+
}
120+
110121
@Test(groups = { "unit" })
111122
public void testDatabase() {
112123
ClickHouseConfig config = new ClickHouseConfig(

clickhouse-client/src/test/java/com/clickhouse/client/ClientIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,8 @@ public void testCustomWriter() throws ClickHouseException {
14411441

14421442
try (ClickHouseResponse resp = req.data(w).executeAndWait()) {
14431443
Assert.assertNotNull(resp);
1444+
} catch (Exception e) {
1445+
Assert.fail("Failed to call executeAndWait(): async=" + b, e);
14441446
}
14451447
Assert.assertTrue(req.getInputStream().get().isClosed(), "Input stream should have been closed");
14461448
}

0 commit comments

Comments
 (0)