desaikomal commented on code in PR #2657:
URL: https://github.com/apache/helix/pull/2657#discussion_r1356887903
##########
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 are relying on 'setPartitionCapacityMap' to reset the cache. Hopefully we
are not calling setPartitinCapacityMap() too frequently.
--
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]