[
https://issues.apache.org/jira/browse/HDDS-12563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17935621#comment-17935621
]
Tsz-wo Sze commented on HDDS-12563:
-----------------------------------
Just found that Guava has a
[MapMaker|https://guava.dev/releases/snapshot-jre/api/docs/com/google/common/collect/MapMaker.html]
class can be used for caching. The following comment suggest using something
like
{code}
new MapMaker().weakValues().makeMap();
{code}
-
https://stackoverflow.com/questions/1802809/javas-weakhashmap-and-caching-why-is-it-referencing-the-keys-not-the-values/1802879#1802879
> Cache and reuse ContainerID object
> ----------------------------------
>
> Key: HDDS-12563
> URL: https://issues.apache.org/jira/browse/HDDS-12563
> Project: Apache Ozone
> Issue Type: Bug
> Components: SCM
> Reporter: Nandakumar
> Assignee: Nandakumar
> Priority: Major
>
> Since {{ContainerID}} is immutable and all the Container IDs are kept in
> SCM's memory, we can cache and reuse the {{ContainerID}} object
> This will avoid re-calculation of {{hash}} and {{proto}} conversion and also
> help (though very little) with SCM's memory consumption.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]