i3wangyi commented on issue #363: Fix the race condition while Helix refresh 
cluster status cache.
URL: https://github.com/apache/helix/pull/363#issuecomment-516538608
 
 
   > There are two ways of solving the race condition by using atomic 
operations, either use ConcurrentHashMap or AtomicBoolean. If you decide to use 
AtomicBoolean, then you don't need the heavy-weight ConcurrentHashMap. I would 
recommend using array and use ChangeType.ordinal() as the index, or some 
immutable data structure to hold the AtomicBooleans
   
   Great suggestion. I thought about it too, it's vulnerable when putting the 
data in Map. ConcurrentHashMap obviously is relatively overkill. My suggestion 
is to use Enum and put AtomicBoolean as the internal field of the enum. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to