ifesdjeen commented on a change in pull request #1195:
URL: https://github.com/apache/cassandra/pull/1195#discussion_r706190354
##########
File path: src/java/org/apache/cassandra/locator/TokenMetadata.java
##########
@@ -656,6 +662,23 @@ public TokenMetadata cloneOnlyTokenMap()
}
}
+ private TokenMetadata cloneOnlyTokenMapWithRingVersion()
Review comment:
Is there a reason why we wouldn't always want to preserve a ring
version? We could then just add `ringVersion` to the map above.
##########
File path:
src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
##########
@@ -457,4 +433,48 @@ protected void validateExpectedOptions() throws
ConfigurationException
throw new ConfigurationException(String.format("Unrecognized
strategy option {%s} passed to %s for keyspace %s", key,
getClass().getSimpleName(), keyspaceName));
}
}
+
+ static class ReplicaCache<K, V>
Review comment:
It looks like we can slightly improve this by introducing a versioned
replicas map (i.e. a class that would hold a final cached version, and final
map of replicas), that would be held in an atomic reference. Then, we don't
need so synchronise on `this`, and can just create and return a new version of
cached replicas.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]