Reduce heap consumption for TokenMap

Description

TokenMap#build builds a map of replica-maps per keyspace.

The replica-map depends on the replication strategy and its options (e.g. RF per DC).

If there are multiple keyspaces using the same replication-strategy + options, heap and CPU can be saved by reusing a matching replica-map. Heap and CPU consumption does not really matter for small clusters, but might be a problem with huge clusters (lots of nodes using vnodes and lots of keyspaces).

I've attached a patch against branch 2.1 for that.

Environment

None

Pull Requests

None

Activity

Show:
Robert Stupp
February 13, 2015, 2:13 PM

Attached a second version that also cuts down heap usage for the map returned by ReplicationStrategy.computeTokenToReplicaMap (divide by number of vnodes).

Alexandre Dutra
December 2, 2015, 12:54 PM

I applied your patch v2 manually here. Can you have a look? Thanks!

Alexandre Dutra
December 2, 2015, 2:10 PM

Turns out the optimization in ReplicationStrategy.computeTokenToReplicaMap is wrong. We reverted that part of the patch.

Fixed

Assignee

Alexandre Dutra

Reporter

Robert Stupp

Labels

None

PM Priority

A

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Minor
Configure