Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1115

Fine-grained AtomicMaps

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Blocker
    • 5.1.0.BETA3, 5.1.0.FINAL
    • None
    • Core
    • None
    • High

    Description

      Atomic Maps are locked by acquiring a single lock on the entire map and this causes concurrency issues for certain use cases. This JIRA is to allow for concurrent modifications of keys within the AtomicMap, provided the keys do not overlap.

      The design is as follows:

      • AtomicMapLookup gets a WL on the AtomicMap's key (AMK) when creating and removing a new AtomicMap
      • Modifications to the AtomicMap (which go through the AtomicMapProxy) do not acquire a WL on AMK. Instead,
      • AdvancedCache exposes a new API, applyDelta(K deltaAwareValueKey, Delta delta, Object... locksToAcquire)
      • AtomicMapProxy makes changes by calling applyDelta and passing in the key within the map that is being modified, along with the delta to apply.
      • The implementation could offer lock pooling to prevent a large number of locks being created for AtomicMaps with a large number of entries
      • On detecting concurrent deletion, updates would fail.

      This can then be used by other Delta/DeltaAware types in future as well, perhaps JSON documents, etc.

      Attachments

        Issue Links

          Activity

            People

              vblagoje Vladimir Blagojevic (Inactive)
              manik_jira Manik Surtani (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: