Skip to content

Commit f2ea0e1

Browse files
authored
Remove deprecated api settings (#1433)
1 parent 32a8bf0 commit f2ea0e1

File tree

24 files changed

+42
-234
lines changed

24 files changed

+42
-234
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ jobs:
179179
matrix:
180180
# most recent LTS releases as well as latest stable builds
181181
# https://github.com/ClickHouse/ClickHouse/pulls?q=is%3Aopen+is%3Apr+label%3Arelease
182-
clickhouse: ["22.3", "22.8", "23.3", "latest"]
182+
clickhouse: ["22.8", "23.3", "23.7", "latest"]
183183
fail-fast: false
184184
timeout-minutes: 15
185185
name: Java client + CH ${{ matrix.clickhouse }}
@@ -234,7 +234,7 @@ jobs:
234234
needs: compile
235235
strategy:
236236
matrix:
237-
clickhouse: ["22.3", "22.8", "23.3", "latest"]
237+
clickhouse: ["22.8", "23.3", "23.7", "latest"]
238238
# here http, http_client and apache_http_client represent different value of http_connection_provider
239239
protocol: ["http", "http_client", "apache_http_client", "grpc"]
240240
fail-fast: false
@@ -293,7 +293,7 @@ jobs:
293293
needs: compile
294294
strategy:
295295
matrix:
296-
clickhouse: ["22.3", "22.8", "23.3", "latest"]
296+
clickhouse: ["22.8", "23.3", "23.7", "latest"]
297297
# grpc is not fully supported, and http_client and apache_http_client do not work in CI environment(due to limited threads?)
298298
protocol: ["http"]
299299
r2dbc: ["1.0.0.RELEASE", "0.9.1.RELEASE"]

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* ClickHouseByteBuffer can no longer be extended
44
* rename ClickHouseByteUtils methods by removing LE suffix
55
* change default databaseTerm from schema to catalog
6+
* remove deprecated API load, dump and connect
7+
* remove use_no_proxy settings
68

79
### New Features
810
* Adding new proxy support [#1338](https://github.com/ClickHouse/clickhouse-java/issues/1338)

clickhouse-benchmark/src/main/java/com/clickhouse/benchmark/client/ClientState.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void doSetup(ServerState serverState) throws ClickHouseException {
9292
"create table if not exists system.test_insert(id String, i Nullable(UInt64), s Nullable(String), t Nullable(DateTime))engine=Memory" };
9393

9494
for (String sql : sqls) {
95-
try (ClickHouseResponse resp = client.connect(server).query(sql).executeAndWait()) {
95+
try (ClickHouseResponse resp = client.read(server).query(sql).executeAndWait()) {
9696

9797
}
9898
}
@@ -102,7 +102,7 @@ public void doSetup(ServerState serverState) throws ClickHouseException {
102102
public void doTearDown(ServerState serverState) throws ClickHouseException {
103103
dispose();
104104

105-
try (ClickHouseResponse resp = client.connect(server).query("truncate table system.test_insert")
105+
try (ClickHouseResponse resp = client.read(server).query("truncate table system.test_insert")
106106
.executeAndWait()) {
107107

108108
} finally {
@@ -161,7 +161,7 @@ public int getRandomNumber() {
161161
}
162162

163163
public ClickHouseRequest<?> newRequest() {
164-
return client.connect(server);
164+
return client.read(server);
165165
}
166166

167167
public void consume(Blackhole blackhole, Future<ClickHouseResponse> future) throws InterruptedException {

clickhouse-cli-client/src/main/java/com/clickhouse/client/cli/ClickHouseCommandLineClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class ClickHouseCommandLineClient extends AbstractClient<ClickHouseComman
2929

3030
@Override
3131
protected boolean checkHealth(ClickHouseNode server, int timeout) {
32-
try (ClickHouseCommandLine cli = getConnection(connect(server).query("SELECT 1"));
32+
try (ClickHouseCommandLine cli = getConnection(read(server).query("SELECT 1"));
3333
ClickHouseCommandLineResponse response = new ClickHouseCommandLineResponse(getConfig(), cli)) {
3434
return response.firstRecord().getValue(0).asInteger() == 1;
3535
} catch (Exception e) {

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

Lines changed: 0 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -364,29 +364,6 @@ static CompletableFuture<ClickHouseResponseSummary> dump(ClickHouseNode server,
364364
return dump(server, tableOrQuery, ClickHouseFile.of(file, compression, format));
365365
}
366366

367-
/**
368-
* Dumps a table or query result from server into a file. File will be
369-
* created/overwrited as needed.
370-
*
371-
* @param server non-null server to connect to
372-
* @param tableOrQuery table name or a select query
373-
* @param format output format to use
374-
* @param compression compression algorithm to use
375-
* @param file output file
376-
* @return non-null future object to get result
377-
* @throws IllegalArgumentException if any of server, tableOrQuery, and output
378-
* is null
379-
* @throws CompletionException when error occurred during execution
380-
* @deprecated will be dropped in 0.5, please use
381-
* {@link #dump(ClickHouseNode, String, String, ClickHouseCompression, ClickHouseFormat)}
382-
* instead
383-
*/
384-
@Deprecated
385-
static CompletableFuture<ClickHouseResponseSummary> dump(ClickHouseNode server, String tableOrQuery,
386-
ClickHouseFormat format, ClickHouseCompression compression, String file) {
387-
return dump(server, tableOrQuery, file, compression, format);
388-
}
389-
390367
/**
391368
* Dumps a table or query result from server into output stream.
392369
*
@@ -438,31 +415,6 @@ static CompletableFuture<ClickHouseResponseSummary> dump(ClickHouseNode server,
438415
});
439416
}
440417

441-
/**
442-
* Dumps a table or query result from server into output stream.
443-
*
444-
* @param server non-null server to connect to
445-
* @param tableOrQuery table name or a select query
446-
* @param format output format to use, null means
447-
* {@link ClickHouseFormat#TabSeparated}
448-
* @param compression compression algorithm to use, null means
449-
* {@link ClickHouseCompression#NONE}
450-
* @param output output stream, which will be closed automatically at the
451-
* end of the call
452-
* @return future object to get result
453-
* @throws IllegalArgumentException if any of server, tableOrQuery, and output
454-
* is null
455-
* @throws CompletionException when error occurred during execution
456-
* @deprecated will be dropped in 0.5, please use
457-
* {@link #dump(ClickHouseNode, String, OutputStream, ClickHouseCompression, ClickHouseFormat)}
458-
* instead
459-
*/
460-
@Deprecated
461-
static CompletableFuture<ClickHouseResponseSummary> dump(ClickHouseNode server, String tableOrQuery,
462-
ClickHouseFormat format, ClickHouseCompression compression, OutputStream output) {
463-
return dump(server, tableOrQuery, output, compression, format);
464-
}
465-
466418
/**
467419
* Loads data from the given pass-thru stream into a table. Pass
468420
* {@link com.clickhouse.data.ClickHouseFile} to load data from a file, which
@@ -543,50 +495,6 @@ static CompletableFuture<ClickHouseResponseSummary> load(ClickHouseNode server,
543495
return load(server, table, ClickHouseFile.of(file, compression, format));
544496
}
545497

546-
/**
547-
* Loads data from a file into table using specified format and compression
548-
* algorithm.
549-
*
550-
* @param server non-null server to connect to
551-
* @param table non-null target table
552-
* @param format input format to use
553-
* @param compression compression algorithm to use
554-
* @param file file to load
555-
* @return future object to get result
556-
* @throws IllegalArgumentException if any of server, table, and input is null
557-
* @throws CompletionException when error occurred during execution
558-
* @deprecated will be dropped in 0.5, please use
559-
* {@link #load(ClickHouseNode, String, String, ClickHouseCompression, ClickHouseFormat)}
560-
* instead
561-
*/
562-
@Deprecated
563-
static CompletableFuture<ClickHouseResponseSummary> load(ClickHouseNode server, String table,
564-
ClickHouseFormat format, ClickHouseCompression compression, String file) {
565-
return load(server, table, file, compression, format);
566-
}
567-
568-
/**
569-
* Loads data from a custom writer into a table using specified format and
570-
* compression algorithm.
571-
*
572-
* @param server non-null server to connect to
573-
* @param table non-null target table
574-
* @param writer non-null custom writer to generate data
575-
* @param compression compression algorithm to use
576-
* @param format input format to use
577-
* @return future object to get result
578-
* @throws IllegalArgumentException if any of server, table, and writer is null
579-
* @throws CompletionException when error occurred during execution
580-
* @deprecated will be dropped in 0.5, please use
581-
* {@link #load(ClickHouseNode, String, ClickHouseWriter, ClickHouseCompression, ClickHouseFormat)}
582-
* instead
583-
*/
584-
@Deprecated
585-
static CompletableFuture<ClickHouseResponseSummary> load(ClickHouseNode server, String table,
586-
ClickHouseFormat format, ClickHouseCompression compression, ClickHouseWriter writer) {
587-
return load(server, table, writer, compression, format);
588-
}
589-
590498
/**
591499
* Loads data from input stream into a table using specified format and
592500
* compression algorithm.
@@ -625,29 +533,6 @@ static CompletableFuture<ClickHouseResponseSummary> load(ClickHouseNode server,
625533
});
626534
}
627535

628-
/**
629-
* Loads data from input stream into a table using specified format and
630-
* compression algorithm.
631-
*
632-
* @param server non-null server to connect to
633-
* @param table non-null target table
634-
* @param format input format to use
635-
* @param compression compression algorithm to use
636-
* @param input input stream, which will be closed automatically at the
637-
* end of the call
638-
* @return future object to get result
639-
* @throws IllegalArgumentException if any of server, table, and input is null
640-
* @throws CompletionException when error occurred during execution
641-
* @deprecated will be dropped in 0.5, please use
642-
* {@link #load(ClickHouseNode, String, InputStream, ClickHouseCompression, ClickHouseFormat)}
643-
* instead
644-
*/
645-
@Deprecated
646-
static CompletableFuture<ClickHouseResponseSummary> load(ClickHouseNode server, String table,
647-
ClickHouseFormat format, ClickHouseCompression compression, InputStream input) {
648-
return load(server, table, input, compression, format);
649-
}
650-
651536
/**
652537
* Creates a new instance compatible with any of the given protocols.
653538
*
@@ -906,70 +791,6 @@ default boolean accept(ClickHouseProtocol protocol) {
906791
return protocol == null || protocol == ClickHouseProtocol.ANY;
907792
}
908793

909-
/**
910-
* Connects to one or more ClickHouse servers. Same as
911-
* {@code connect(ClickHouseNodes.of(uri))}.
912-
*
913-
* @param endpoints non-empty URIs separated by comma
914-
* @return non-null request object holding references to this client and node
915-
* provider
916-
* @deprecated will be dropped in 0.5, please use {@link #read(String)} instead
917-
*/
918-
@Deprecated
919-
default ClickHouseRequest<?> connect(String endpoints) {
920-
return read(endpoints);
921-
}
922-
923-
/**
924-
* Connects to a list of managed ClickHouse servers.
925-
*
926-
* @param nodes non-null list of servers to connect to
927-
* @return non-null request object holding references to this client and node
928-
* provider
929-
* @deprecated will be dropped in 0.5, please use {@link #read(ClickHouseNodes)}
930-
* instead
931-
*/
932-
@Deprecated
933-
default ClickHouseRequest<?> connect(ClickHouseNodes nodes) {
934-
return read(nodes);
935-
}
936-
937-
/**
938-
* Connects to a ClickHouse server.
939-
*
940-
* @param node non-null server for read
941-
* @return non-null request object holding references to this client and node
942-
* provider
943-
* @deprecated will be dropped in 0.5, please use {@link #read(ClickHouseNode)}
944-
* instead
945-
*/
946-
@Deprecated
947-
default ClickHouseRequest<?> connect(ClickHouseNode node) {
948-
return read(node);
949-
}
950-
951-
/**
952-
* Connects to a ClickHouse server defined by the given
953-
* {@link java.util.function.Function}. You can pass either
954-
* {@link ClickHouseCluster}, {@link ClickHouseNodes} or {@link ClickHouseNode}
955-
* here, as all of them implemented the same interface.
956-
*
957-
* <p>
958-
* Please be aware that this is nothing but an intention, so no network
959-
* communication happens until {@link #execute(ClickHouseRequest)} is
960-
* invoked(usually triggered by {@code request.execute()}).
961-
*
962-
* @param nodeFunc function to get a {@link ClickHouseNode} to connect to
963-
* @return non-null request object holding references to this client and node
964-
* provider
965-
* @deprecated will be dropped in 0.5, please use {@link #read(Function, Map)}
966-
* instead
967-
*/
968-
@Deprecated
969-
default ClickHouseRequest<?> connect(Function<ClickHouseNodeSelector, ClickHouseNode> nodeFunc) {
970-
return read(nodeFunc, null);
971-
}
972-
973794
/**
974795
* Connects to one or more ClickHouse servers to read. Same as
975796
* {@code read(ClickHouseNodes.of(uri))}.

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ public static Map<ClickHouseOption, Serializable> toClientOptions(Map<?, ?> prop
235235
private final boolean useBlockingQueue;
236236
private final boolean useCompilation;
237237
private final boolean useObjectsInArray;
238-
private final boolean useNoProxy;
239238
private final boolean useServerTimeZone;
240239
private final boolean useServerTimeZoneForDates;
241240
private final TimeZone timeZoneForDate;
@@ -353,7 +352,6 @@ public ClickHouseConfig(Map<ClickHouseOption, Serializable> options, ClickHouseC
353352
this.useBlockingQueue = getBoolOption(ClickHouseClientOption.USE_BLOCKING_QUEUE);
354353
this.useCompilation = getBoolOption(ClickHouseClientOption.USE_COMPILATION);
355354
this.useObjectsInArray = getBoolOption(ClickHouseClientOption.USE_OBJECTS_IN_ARRAYS);
356-
this.useNoProxy = getBoolOption(ClickHouseClientOption.USE_NO_PROXY);
357355
this.useServerTimeZone = getBoolOption(ClickHouseClientOption.USE_SERVER_TIME_ZONE);
358356
this.useServerTimeZoneForDates = getBoolOption(ClickHouseClientOption.USE_SERVER_TIME_ZONE_FOR_DATES);
359357

@@ -662,10 +660,6 @@ public boolean isUseObjectsInArray() {
662660
* @deprecated will be dropped in 0.5, please use {@link #getProxyType()}
663661
* instead
664662
*/
665-
@Deprecated
666-
public boolean isUseNoProxy() {
667-
return useNoProxy;
668-
}
669663

670664
public ClickHouseProxyType getProxyType() {
671665
return proxyType;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ protected void queryClusterNodes(Collection<ClickHouseNode> seeds, Collection<Cl
415415

416416
try (ClickHouseClient client = ClickHouseClient.builder().agent(false)
417417
.nodeSelector(ClickHouseNodeSelector.of(server.getProtocol())).build()) {
418-
ClickHouseRequest<?> request = client.connect(server)
418+
ClickHouseRequest<?> request = client.read(server)
419419
.format(ClickHouseFormat.RowBinaryWithNamesAndTypes);
420420
String clusterName = server.getCluster();
421421
Set<String> clusters = new LinkedHashSet<>();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ public void abort() {
420420
}
421421

422422
id.updateAndGet(x -> {
423-
try (ClickHouseResponse response = ClickHouseClient.newInstance(server.getProtocol()).connect(server)
423+
try (ClickHouseResponse response = ClickHouseClient.newInstance(server.getProtocol()).read(server)
424424
.query("KILL TRANSACTION WHERE tid=" + x.asTupleString()).executeAndWait()) {
425425
// ignore
426426
} catch (ClickHouseException e) {

clickhouse-client/src/main/java/com/clickhouse/client/config/ClickHouseClientOption.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -377,16 +377,6 @@ public enum ClickHouseClientOption implements ClickHouseOption {
377377
*/
378378
USE_OBJECTS_IN_ARRAYS("use_objects_in_arrays", ClickHouseDataConfig.DEFAULT_USE_OBJECT_IN_ARRAY,
379379
"Whether Object[] should be used instead of primitive arrays."),
380-
/**
381-
* Whether to access ClickHouse server directly without using system wide proxy
382-
* including the one defined in JVM system properties.
383-
*
384-
* @deprecated will be dropped in 0.5, please use {@link #PROXY_TYPE} instead
385-
*/
386-
@Deprecated
387-
USE_NO_PROXY("use_no_proxy", false,
388-
"Whether to access ClickHouse server directly without using system wide proxy including the one defined in JVM system properties."),
389-
390380
/**
391381
* Type of proxy can be used to access ClickHouse server. To use an HTTP/SOCKS
392382
* proxy, you must specify the {@link #PROXY_HOST} and {@link #PROXY_PORT}.

0 commit comments

Comments
 (0)