mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
transport/server: declare a new "CLIENT_OPTIONS" option as supported
Declare support for a 'CLIENT_OPTIONS' startup key. This key is meant to be used by drivers for sending client-specific configurations like request timeouts values, retry policy configuration, etc. The value of this key can be any string in general (according to the CQL binary protocol), however, it's expected to be some structured format, e.g. JSON. Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
This commit is contained in:
@@ -74,6 +74,8 @@ The keys and values are:
|
||||
as an indicator to which shard client wants to connect. The desired shard number
|
||||
is calculated as: `desired_shard_no = client_port % SCYLLA_NR_SHARDS`.
|
||||
Its value is a decimal representation of type `uint16_t`, by default `19142`.
|
||||
- `CLIENT_OPTIONS` is a string containing a JSON object representation that
|
||||
contains CQL Driver configuration, e.g. load balancing policy, retry policy, timeouts, etc.
|
||||
|
||||
Currently, one `SCYLLA_SHARDING_ALGORITHM` is defined,
|
||||
`biased-token-round-robin`. To apply the algorithm,
|
||||
|
||||
@@ -1653,6 +1653,9 @@ std::unique_ptr<cql_server::response> cql_server::connection::make_supported(int
|
||||
opts.insert({"CQL_VERSION", cql3::query_processor::CQL_VERSION});
|
||||
opts.insert({"COMPRESSION", "lz4"});
|
||||
opts.insert({"COMPRESSION", "snappy"});
|
||||
// CLIENT_OPTIONS value is a JSON string that can be used to pass client-specific configuration,
|
||||
// e.g. CQL driver configuration.
|
||||
opts.insert({"CLIENT_OPTIONS", ""});
|
||||
if (_server._config.allow_shard_aware_drivers) {
|
||||
opts.insert({"SCYLLA_SHARD", format("{:d}", this_shard_id())});
|
||||
opts.insert({"SCYLLA_NR_SHARDS", format("{:d}", smp::count)});
|
||||
|
||||
Reference in New Issue
Block a user