I used ConcurrentHashMap at first but switched to this coarse grained lock because 1. Lock contention should be very low on QueryMetrics object. Normally it is used by single thread. Concurrent runners would create separate QueryMetrics for each child runner. 2. Imagine a thread adds a dimension and a metric, in order for the subsequent emit() reflects the newly added dimension and metric, making each Map concurrent is not enough. We need synchronization across these fields.
[ Full content available at: https://github.com/apache/incubator-druid/pull/6402 ] This message was relayed via gitbox.apache.org for [email protected]
