[infinispan-issues] [JBoss JIRA] (ISPN-2181) Allow to inject the current cache into Mapper/Reducer/Callable objects

Vladimir Blagojevic (JIRA) jira-events at lists.jboss.org
Tue Aug 21 07:34:15 EDT 2012


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

Vladimir Blagojevic commented on ISPN-2181:
-------------------------------------------

Pete, a bit more guidance please. So for step 1) I have to do something similar to [how we implement a Bean for RemoteCache| https://github.com/infinispan/infinispan/blob/master/cdi/extension/src/main/java/org/infinispan/cdi/InfinispanExtension.java#L191]? I don't think I need to capture these injection points like we do for RemoteBean? When you mention extraction from cc you mean extraction from CreationalContext? Do I need to save Producer for Cache and use it to produce Cache similar to [RemoteCache|https://github.com/infinispan/infinispan/blob/master/cdi/extension/src/main/java/org/infinispan/cdi/InfinispanExtension.java#L198]?

Step 3) So I put the cache into CreationContext in onPreExecute callback? I simply use the same [BeanManager|https://github.com/infinispan/infinispan/blob/master/cdi/extension/src/main/java/org/infinispan/cdi/CDIMapReduceTaskLifecycle.java#L22], get the CreationContext and call push with the specific Cache? Anything else? What about onPostExecute, do I have to do some cleanup?

For step 0, lets call this qualifier @ImpliedInputTaskCache. Do I need to make a producer for it?



  
 
                
> Allow to inject the current cache into Mapper/Reducer/Callable objects
> ----------------------------------------------------------------------
>
>                 Key: ISPN-2181
>                 URL: https://issues.jboss.org/browse/ISPN-2181
>             Project: Infinispan
>          Issue Type: Enhancement
>          Components: CDI integration
>    Affects Versions: 5.1.5.FINAL, 5.2.0.ALPHA2
>            Reporter: Nicolas Filotto
>            Assignee: Vladimir Blagojevic
>             Fix For: 5.2.0.ALPHA4, 5.2.0.FINAL
>
>
> Thanks to ISPN-1636, it is now possible to inject the cache into Mapper/Reducer/Callable objects however the cache injected is the default cache not the cache for which the MapReduceTask/DistributedExecutorService has been created which is quite error prone since we don't expect to get the default cache but the current cache.

--
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