Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3020

Review of SyncRequestProcessor

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.6.0
    • None
    • Patch

    Description

      1. Use ArrayDeque instead of LinkedList
      2. Use ThreadLocalRandom instead of Random
      3. Remove the 'running' flag - use the Thread#join facility to detect if the thread has stopped running. Using a flag can cause race condition issues and is superfluous.
      4. Make static final variable names in all caps
      5. General cleanup

      This class is likely to be faster than Stack when used as a stack, and faster than LinkedList when used as a queue.

      https://docs.oracle.com/javase/7/docs/api/java/util/ArrayDeque.html

      Attachments

        1. ZOOKEEPER.3020.1.patch
          6 kB
          David Mollitor

        Activity

          People

            belugabehr David Mollitor
            belugabehr David Mollitor
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 4h
                4h