[
https://issues.apache.org/jira/browse/YARN-9135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16768360#comment-16768360
]
Peter Bacsko commented on YARN-9135:
------------------------------------
{quote}Using the immutable type in the definition of the methods informs
clients that the can't modify the collection{quote}
What I found is that people have different preference over this:
[https://stackoverflow.com/questions/38087900/is-it-better-to-return-an-immutablemap-or-a-map]
I'm still leaning towards returning a more generic Map. BTW if you use
{{Collections.unmodifiableMap()}} like this, it behaves the same way:
{{Map<String, String> copy = Collections.unmodifiableMap(new HashMap<String,
String>(original)); // returns Map<String,String>}}
Anyway I'm ok to +1 it if you want to keep it.
> NM State store ResourceMappings serialization are tested with Strings instead
> of real Device objects
> ----------------------------------------------------------------------------------------------------
>
> Key: YARN-9135
> URL: https://issues.apache.org/jira/browse/YARN-9135
> Project: Hadoop YARN
> Issue Type: Improvement
> Reporter: Szilard Nemeth
> Assignee: Szilard Nemeth
> Priority: Major
> Attachments: YARN-9135.001.patch, YARN-9135.003.patch,
> YARN-9135.004.patch
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]