[infinispan-issues] [JBoss JIRA] (ISPN-8946) All collection wrappers should always delegate to underlying collections where available

William Burns (JIRA) issues at jboss.org
Thu Mar 15 16:54:00 EDT 2018


    [ https://issues.jboss.org/browse/ISPN-8946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13546692#comment-13546692 ] 

William Burns commented on ISPN-8946:
-------------------------------------

Also we should finally fix this so that each level of interceptor properly handle what they are supposed to.

The main ones are

(KeySet|EntrySet)Command - the collections produced from here should only ever touch the underlying DataContainer
CacheLoaderInterceptor - the collections produced here should only ever read/write from the store and delegate to super collection
PrefetchInterceptor - this should only affect iterator and stream operations it seems and delegate everything else to super collection
TxInterceptor - the collections produced here should only ever read/write from the transaction and delegate to the super collection
DistributionBulkInterceptor - the collections here should write directly to the cache (as we are in a clustered scenario)

This leads to a very distinct set of responsibilities. Also then flags such as CACHE_MODE_LOCAL should just work without having to read them except at the DistributionBulkInterceptor or "InvalidationBulkInterceptor" level.

The various cache modes would thus be covered in the following manner:
LOCAL (everything is handled in CacheLoaderInterceptor or commands)
REPL / DIST (DistributionBulkInterceptor relies on all writes to be handled at it's level directly to the cache and uses local reads when necessary)
SCATTERD same as REPL / DIST but Prefetch also sits between bulk and cache loader to guarantee proper iterator/stream
INVAL we will need to add a new interceptor where bulk usually is for the sole purpose of handling invalidation write methods on these collections that is passed directly to the cache object.

We also have the collections created at the Cache level (ie. EncoderCache). This should always delegate to the underlying collection and just ensure that all keys/values are properly converted to or from the proper formats.


> All collection wrappers should always delegate to underlying collections where available
> ----------------------------------------------------------------------------------------
>
>                 Key: ISPN-8946
>                 URL: https://issues.jboss.org/browse/ISPN-8946
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 9.2.0.Final
>            Reporter: William Burns
>            Assignee: William Burns
>
> All places that override values returned from keySet and entrySet should always delegate appropriately to the underlying keySet or entrySet. We should try to be as minimally invasive to each level down as possible. An example would be that we shouldn't create copies of said collections if possible and instead just use delegates.
> https://github.com/infinispan/infinispan/pull/5794#discussion_r173789766



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the infinispan-issues mailing list