Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import com.clickhouse.data.ClickHouseValue;
import com.clickhouse.data.ClickHouseValues;
import com.clickhouse.data.ClickHouseWriter;
import com.clickhouse.logging.Logger;
import com.clickhouse.logging.LoggerFactory;

/**
* A unified interface defines Java client for ClickHouse. A client can only
Expand All @@ -56,6 +58,7 @@
* implementation properly in runtime.
*/
public interface ClickHouseClient extends AutoCloseable {
Logger LOG = LoggerFactory.getLogger(ClickHouseClient.class);

/**
* Returns a builder for creating a new client.
Expand Down Expand Up @@ -959,8 +962,8 @@ default boolean ping(ClickHouseNode server, int timeout) {
.get(timeout, TimeUnit.MILLISECONDS)) {
return resp != null;
} catch (Exception e) {
// ignore
e.printStackTrace();
LOG.debug("Failed to connect to the server", e);
return false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,7 @@ public boolean ping(long timeout) {
try (QueryResponse response = query("SELECT 1 FORMAT TabSeparated").get(timeout, TimeUnit.MILLISECONDS)) {
return true;
} catch (Exception e) {
LOG.debug("Failed to connect to the server", e);
return false;
}
} else {
Expand Down
Loading