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

Pete Muir (JIRA) jira-events at lists.jboss.org
Tue Aug 21 08:47:15 EDT 2012


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

Pete Muir commented on ISPN-2181:
---------------------------------

{quote}
So for step 1) I have to do something similar to how we implement a Bean for RemoteCache? I don't think I need to capture these injection points like we do for RemoteBean?
{quote}

You just need one Bean, you don't need to call it in a loop or anything.

{quote}
 When you mention extraction from cc you mean extraction from CreationalContext?
{quote}

Yes.

{quote}
Do I need to save Producer for Cache and use it to produce Cache similar to RemoteCache?
{quote}

I would just implement the necessary custom logic in the ContextualLifecycle. I think you don't need any producer.

There, you extract the right cache from the creational context.

{quote}
Step 3) So I put the cache into CreationContext in onPreExecute callback?
{quote}

Yes.

{quote}
I simply use the same BeanManager, get the CreationContext and call push with the specific Cache?
{quote}

Hmm, I guess you can't use the default creational context. You can probably just wrap CreationalContext and add some additional field to it, and then cast it. If this breaks Weld, it's a bug in Weld, and we can look at other options

{quote}
 Anything else? What about onPostExecute, do I have to do some cleanup?
{quote}

Don't think so.

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

No. Just give the bean in (1) that qualifier.
                
> 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