Interface DriverConfigReporter
-
- All Known Implementing Classes:
DefaultDriverConfigReporter
@Beta public interface DriverConfigReporter
Builds theDRIVER_CONFIGpayload that the control connection sends in its CQLSTARTUPoptions, so ScyllaDB can store it insystem.clients.client_optionsand operators can inspect a client's effective driver settings while investigating incidents.Only the control connection carries the blob; pooled connections are correlated back to it via the
SESSION_IDstartup option, whichConnectionsends on every connection independently of this reporter and ofCluster.Builder.withDriverConfigReporting(boolean).system.clients.client_optionsis per node: only the node holding the control connection storesDRIVER_CONFIG; other nodes only seeSESSION_ID-bearing pooled- connection rows. Consumers must query and aggregate across all nodes to see the full picture.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringbuildReport()Builds the configuration report, or returnsnullif it could not be built (in which case noDRIVER_CONFIGoption is sent).
-
-
-
Method Detail
-
buildReport
String buildReport()
Builds the configuration report, or returnsnullif it could not be built (in which case noDRIVER_CONFIGoption is sent).Called once per control connection, from its
STARTUPframe assembly, and not cached: the report describes the objects in force at the handshake that sends it, rather than the configuration theClusterwas constructed from. Implementations must therefore tolerate being called on a Netty event loop, and repeatedly over a cluster's lifetime.Implementations must not throw: a failure to build the report must be swallowed (and logged) rather than propagated, so that a diagnostic aid can never break cluster initialization. For the same reason they must bound the report's size and return
nullrather than an oversized one:STARTUPoption values carry an unchecked 16-bit length prefix, so a value over 65535 encoded bytes corrupts the frame instead of merely being useless. The built-in reporter caps the report at 32KiB of UTF-8, the limit the other ScyllaDB drivers apply.An implementation that cannot even be loaded is handled one level up rather than here:
DefaultDriverConfigReporterneeds Jackson, and on a classpath without it the failure is aLinkageErrorraised while initializing the class, which no method of this interface could catch.Connection.Factory.buildDriverConfigReportcontains that and reports nothing, so the connection is still established.- Returns:
- the report to send under the
DRIVER_CONFIGstartup option, ornullto send nothing.
-
-