You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by lvfangmin <gi...@git.apache.org> on 2018/08/08 06:06:09 UTC

[GitHub] zookeeper issue #590: [ZOOKEEPER-1177] Add the memory optimized watch manage...

Github user lvfangmin commented on the issue:

    https://github.com/apache/zookeeper/pull/590
  
    @hanm the code complained by Findbug are all correct and expected:
    
    1. System.exit if create watch manager failed in DataTree
    It's using the factory to create the watch manager based on the class name, in case we cannot initialize the class due to invalid classname, we have to exit.
    
    2. BitHashSet.elementCount not synchronized in iterator()
    It cannot guarantee thread safe during iteration inside this function, so it's marked as non thread safe in the comment, and the caller needs to and is synchronizing it during iterating.
    
    3. Synchronize on AtomicInteger
    In the code, we synchronize on it to do wait/notify, but not relying on the synchronization to control the  AtomicInteger value update, so it's used correctly.


---