Class PreSessionTelemetryClient
- java.lang.Object
-
- net.snowflake.client.jdbc.telemetry.PreSessionTelemetryClient
-
- All Implemented Interfaces:
Telemetry
@SnowflakeJdbcInternalApi public class PreSessionTelemetryClient extends Object implements Telemetry
A telemetry client that buffers telemetry data until a real telemetry client becomes available. Used for scenario where telemetry needs to be collected before a session is established, such as during SSL/TLS setup and certificate validation.
-
-
Constructor Summary
Constructors Constructor Description PreSessionTelemetryClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLogToBatch(TelemetryData log)Attempt to add log to batch, and suppress exceptions thrown in case of failurevoidclose()Close telemetry connector and send any unsubmitted logsbooleanhasRealTelemetryClient()voidpostProcess(String queryId, String sqlState, int vendorCode, Throwable ex)A hook for post-processing after sending telemetry data.Future<Boolean>sendBatchAsync()Send all cached logs to servervoidsetRealTelemetryClient(Telemetry realClient)
-
-
-
Method Detail
-
addLogToBatch
public void addLogToBatch(TelemetryData log)
Description copied from interface:TelemetryAttempt to add log to batch, and suppress exceptions thrown in case of failure- Specified by:
addLogToBatchin interfaceTelemetry- Parameters:
log- entry to add
-
setRealTelemetryClient
public void setRealTelemetryClient(Telemetry realClient)
-
sendBatchAsync
public Future<Boolean> sendBatchAsync()
Description copied from interface:TelemetrySend all cached logs to server- Specified by:
sendBatchAsyncin interfaceTelemetry- Returns:
- future indicating whether the logs were sent successfully
-
close
public void close()
Description copied from interface:TelemetryClose telemetry connector and send any unsubmitted logs
-
postProcess
public void postProcess(String queryId, String sqlState, int vendorCode, Throwable ex)
Description copied from interface:TelemetryA hook for post-processing after sending telemetry data. Can be used, for example, for additional error handling.- Specified by:
postProcessin interfaceTelemetry- Parameters:
queryId- The query idsqlState- The SQL state as defined in net.snowflake.common.core.SqlStatevendorCode- The vendor code for localized messagesex- The throwable that caused this.
-
hasRealTelemetryClient
public boolean hasRealTelemetryClient()
-
-