@@ -118,9 +118,7 @@ private Client(Set<String> endpoints, Map<String,String> configuration) {
118118 this .getterMethods = new HashMap <>();
119119 this .hasDefaults = new HashMap <>();
120120
121- final int numThreads = Integer .parseInt (configuration .get (ClickHouseClientOption .MAX_THREADS_PER_CLIENT .getKey ()));
122- this .sharedOperationExecutor = Executors .newFixedThreadPool (numThreads , new DefaultThreadFactory ("chc-operation" ));
123- LOG .debug ("Query executor created with {} threads" , numThreads );
121+ this .sharedOperationExecutor = Executors .newCachedThreadPool (new DefaultThreadFactory ("chc-operation" ));
124122 }
125123
126124 /**
@@ -458,9 +456,6 @@ public boolean ping() {
458456 * @return true if the server is alive, false otherwise
459457 */
460458 public boolean ping (long timeout ) {
461- ValidationUtils .checkRange (timeout , TimeUnit .SECONDS .toMillis (1 ), TimeUnit .MINUTES .toMillis (10 ),
462- "timeout" );
463-
464459 try (ClickHouseClient client = ClientV1AdaptorHelper .createClient (configuration )) {
465460 return client .ping (getServerNode (), Math .toIntExact (timeout ));
466461 }
@@ -851,9 +846,9 @@ public CompletableFuture<Records> queryRecords(String sqlQuery, QuerySettings se
851846 public List <GenericRecord > queryAll (String sqlQuery ) {
852847 try {
853848 int operationTimeout = getOperationTimeout ();
854- QueryResponse response = operationTimeout == 0 ? query ( sqlQuery ). get () :
855- query (sqlQuery ).get (operationTimeout , TimeUnit . MILLISECONDS );
856- try ( response ) {
849+
850+ try ( QueryResponse response = operationTimeout == 0 ? query (sqlQuery ).get () :
851+ query ( sqlQuery ). get ( operationTimeout , TimeUnit . MILLISECONDS ) ) {
857852 List <GenericRecord > records = new ArrayList <>();
858853 if (response .getResultRows () > 0 ) {
859854 ClickHouseBinaryFormatReader reader = new RowBinaryWithNamesAndTypesFormatReader (response .getInputStream ());
0 commit comments