Use a token replica cache based on replication strategy options

Description

The driver will pre calculate the replicas for each token on each keyspace that is accessed, storing the replicas as part of the keyspace metadata.

When dealing with several keyspaces on the same Client instance, this behaviour can cause significant memory consumption.

Given that normally there are fewer combinations of replication strategy options than keyspaces, a solution is to calculate and cache once per unique replication strategy options.

Environment

None

Pull Requests

None

Assignee

Unassigned

Reporter

Jorge Bay Gondra

Reviewer

None

Fix versions

None

Labels

None

Components

None

PM Priority

None

Pull Request

None

Priority

Major