zpinto commented on code in PR #2657:
URL: https://github.com/apache/helix/pull/2657#discussion_r1357268766
##########
helix-core/src/main/java/org/apache/helix/model/ResourceConfig.java:
##########
@@ -389,6 +390,12 @@ public void setPreferenceLists(Map<String, List<String>>
instanceLists) {
* @throws IOException - when JSON conversion fails
*/
public Map<String, Map<String, Integer>> getPartitionCapacityMap() throws
IOException {
+ // It is very expensive to deserialize the partition capacity map every
time this is called.
+ // Cache the deserialized map to avoid the overhead.
+ if (_deserializedPartitionCapacityMap != null) {
Review Comment:
We do not call `setPartitionCapacityMap` anywhere but tests. Cache is
refreshed by replacing ResourceConfig HelixProperty in dataProvider when there
is a keyChange. Replacing the property will ensure that
_deserializedPartitionCapacityMap will be recomputed if ResourceConfig
partition capacity maps are changed.
--
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]