[infinispan-issues] [JBoss JIRA] (ISPN-1115) Fine-grained AtomicMaps
Randall Hauch (Issue Comment Edited) (JIRA)
jira-events at lists.jboss.org
Thu Oct 13 09:08:17 EDT 2011
[ https://issues.jboss.org/browse/ISPN-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634453#comment-12634453 ]
Randall Hauch edited comment on ISPN-1115 at 10/13/11 9:06 AM:
---------------------------------------------------------------
I've reused the DeltaAware functionality in my prototype for ISPN-1103, which has to do with a soft schema-based solution using JSON documents and JSON Schema documents. (The SchematicValue actually contains an in-memory representation of a JSON/BSON document, since storing a string would require parsing the string before use.)
Ideally the [SchematicEntry|https://github.com/rhauch/infinispan/blob/ISPN-1103/schematic/src/main/java/org/infinispan/schematic/SchematicEntry.java] (akin to AtomicMap) could use fine-grained locks on the individual fields (potentially in nested documents). However, we need a way to plug this 'custom' delta-aware value into Infinispan and it's fine-grained locking capability.
Note that I've tried to follow the same pattern as AtomicMap (interface), AtomicHashMap (impl), AtomicMapDelta (Delta impl), and AtomicHashMapProxy (proxy that hides the delta and atomic-ness). See the [branch|https://github.com/rhauch/infinispan/tree/ISPN-1103/schematic/src/main/java/org/infinispan/schematic/internal] for details.
I am looking for feedback on ISPN-1103, so if interested please comment on that issue.
was (Author: rhauch):
I've reused the DeltaAware functionality in my prototype for ISPN-1103, which has to do with a soft schema-based solution using JSON documents and JSON Schema documents. (The SchematicValue actually contains an in-memory representation of a JSON/BSON document, since storing a string would require parsing the string before use.)
Ideally the [SchematicEntry|https://github.com/rhauch/infinispan/blob/ISPN-1103/schematic/src/main/java/org/infinispan/schematic/SchematicEntry.java] (akin to AtomicHashMap) could use fine-grained locks on the individual fields (potentially in nested documents). However, we need a way to plug this 'custom' delta-aware value into Infinispan.
Note that I've tried to follow the same pattern as AtomicMap (interface), AtomicHashMap (impl), AtomicMapDelta (Delta impl), and AtomicHashMapProxy (proxy that hides the delta and atomic-ness). See the [branch|https://github.com/rhauch/infinispan/tree/ISPN-1103/schematic/src/main/java/org/infinispan/schematic/internal] for details.
I am looking for feedback on ISPN-1103, so if interested please comment on that issue.
> Fine-grained AtomicMaps
> -----------------------
>
> Key: ISPN-1115
> URL: https://issues.jboss.org/browse/ISPN-1115
> Project: Infinispan
> Issue Type: Feature Request
> Components: Core API
> Reporter: Manik Surtani
> Assignee: Vladimir Blagojevic
> Priority: Blocker
> Fix For: 5.1.0.BETA2, 5.1.0.FINAL
>
>
> 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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list