Was this page helpful?
ScyllaDB Java Driver is available under the Apache v2 License. ScyllaDB Java Driver is a fork of DataStax Java Driver. See Copyright here.
Users can inject an identifier for each individual CQL request, and such ID can be written in to the custom payload to correlate a request across the driver and the Apache Cassandra server.
A request ID generator needs to generate both:
Session request ID: an identifier for an entire session.execute() call
Node request ID: an identifier for the execution of a CQL statement against a particular node. There can be one or more node requests for a single session request, due to retries or speculative executions.
Usage:
Inject ID generator: set the desired RequestIdGenerator in advanced.request-id.generator.class.
Add ID to custom payload: the default behavior of a RequestIdGenerator is to add the request ID into the custom payload with the key request-id. Override RequestIdGenerator.getDecoratedStatement to customize the behavior.
Request ID generator can be declared in the configuration as follows:
datastax-java-driver.advanced.request-id.generator {
class = com.example.app.MyGenerator
}
To register your own request ID generator, specify the name of the class
that implements RequestIdGenerator.
The generated ID will be added to the log message of CqlRequestHandler, and propagated to other classes, e.g. the request trackers.
Was this page helpful?
ScyllaDB Java Driver is available under the Apache v2 License. ScyllaDB Java Driver is a fork of DataStax Java Driver. See Copyright here.