Class ClientRoutesConfig.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • addEndpoint

        @NonNull
        public ClientRoutesConfig.Builder addEndpoint​(@NonNull
                                                      ClientRouteProxy endpoint)
        Adds an endpoint to the configuration.
        Parameters:
        endpoint - the endpoint to add (must not be null).
        Returns:
        this builder.
        Throws:
        IllegalArgumentException - if an endpoint with the same connection ID has already been added.
      • withEndpoints

        @NonNull
        public ClientRoutesConfig.Builder withEndpoints​(@NonNull
                                                        List<ClientRouteProxy> endpoints)
        Sets the endpoints for the configuration, replacing any previously added endpoints.
        Parameters:
        endpoints - the endpoints to set (must not be null or empty).
        Returns:
        this builder.
      • withNativeTransportPort

        @NonNull
        public ClientRoutesConfig.Builder withNativeTransportPort​(int port)
        Sets the native transport port of the cluster nodes. This is used as the fallback port for broadcastRpcAddress when system tables do not include port information. Only needed for clusters using a non-standard native transport port. Defaults to 9042.
        Parameters:
        port - the native transport port.
        Returns:
        this builder.
      • withShardAwareness

        @NonNull
        public ClientRoutesConfig.Builder withShardAwareness​(boolean shardAwareness)
        Sets whether shard awareness is enabled.

        When true, the driver assumes the load balancer is configured to forward the driver's original source port to ScyllaDB (e.g. via Proxy Protocol v2), enabling shard-aware connection routing end-to-end through the load balancer.

        Requires advanced-shard-awareness.enabled = true (the default).

        Parameters:
        shardAwareness - true to enable shard awareness.
        Returns:
        this builder.