Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-2779

Use ConcurrentHashMap in RAMDirectory

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.1, 4.0-ALPHA
    • core/store
    • None
    • New, Patch Available

    Description

      RAMDirectory synchronizes on its instance in many places to protect access to map of RAMFiles, in addition to updating the sizeInBytes member. In many places the sync is done for 'read' purposes, while only in few places we need 'write' access. This looks like a perfect use case for ConcurrentHashMap

      Also, syncing around sizeInBytes is unnecessary IMO, since it's an AtomicLong ...

      I'll post a patch shortly.

      Attachments

        1. LUCENE-2779.patch
          5 kB
          Shai Erera
        2. LUCENE-2779.patch
          5 kB
          Shai Erera
        3. TestCHM.java
          2 kB
          Yonik Seeley
        4. LUCENE-2779-backwardsfix.patch
          1 kB
          Uwe Schindler
        5. LUCENE-2779.patch
          7 kB
          Shai Erera
        6. LUCENE-2779.patch
          7 kB
          Shai Erera

        Issue Links

          Activity

            People

              shaie Shai Erera
              shaie Shai Erera
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: