public boolean ping(long timeout) {
        long startTime = System.nanoTime();
        try {
            CompletableFuture<QueryResponse> future = query("SELECT 1 FORMAT TabSeparated");
            try (QueryResponse response = timeout > 0 ? future.get(timeout, TimeUnit.MILLISECONDS) : future.get()) {
                return true;
            }
        } catch (Exception e) {
            LOG.debug("Failed to connect to the server (Duration: {})", System.nanoTime() - startTime, e);
            return false;
        }
    }
Pings the server to check if it is alive. Maximum timeout is 10 minutes.

@param timeout timeout in milliseconds
@return true if the server is alive, false otherwise
client-v2/src/main/java/com/clickhouse/client/api/Client.java