[ 
https://issues.apache.org/jira/browse/YARN-3390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14508121#comment-14508121
 ] 

Sangjin Lee commented on YARN-3390:
-----------------------------------

bq. In TimelineCollectorManager, I'm still having this question, although we 
may not want to address it in this JIRA: are there any special consistency 
requirements that prevent us from using ConcurrentHashMap?

I can answer this as I added that code. :) In putIfAbsent(), it needs to start 
the collector as well if get() returns null. If we used ConcurrentHashMap and 
removed synchronization, multiple threads could start their own collectors 
unnecessarily. It is probably not a show stopper but less than desirable. Also, 
in real life the contention on TimelineCollectorManager is low enough that 
synchronization should be perfectly adequate. If we want to do this without 
synchronization, then we would want to use something like guava's LoadingCache.

> Reuse TimelineCollectorManager for RM
> -------------------------------------
>
>                 Key: YARN-3390
>                 URL: https://issues.apache.org/jira/browse/YARN-3390
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: timelineserver
>            Reporter: Zhijie Shen
>            Assignee: Zhijie Shen
>         Attachments: YARN-3390.1.patch
>
>
> RMTimelineCollector should have the context info of each app whose entity  
> has been put



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to