@@ -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 )
0 commit comments