You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Neelesh <ne...@gmail.com> on 2016/02/27 01:14:36 UTC

Setting jobcontext attributes for jobs submitted via run/call

Hi all,
Im trying to use jobcontext attributes to control the behavior of my custom
CollisionSpi implementation.

Is it possible to set job context attributes for jobs submitted thu
IgniteCompute#run() / IgniteCompute#call() and other compute methods? Or Do
I have to use custom computetask/computejob for this?

Any help appreciated

Thanks!

-Neelesh

Re: Setting jobcontext attributes for jobs submitted via run/call

Posted by Neelesh <ne...@gmail.com>.
Val, that works like a charm. Thanks! The API documentation for the
annotation JobContextResource says it can be used only into ComputeJobs. It
wasn't very clear it could be used inside an IgniteRunnable as well. Thanks!
-neelesh

On Fri, Feb 26, 2016 at 4:30 PM, vkulichenko <va...@gmail.com>
wrote:

> Hi Neelesh,
>
> You can inject job context into the closure using annotation:
>
> public class MyGridJob implements IgniteRunnable {
>     @JobContextResource
>     private ComputeJobContext jobCtx;
>
>     ...
> }
>
> Let me know if it works for you.
>
> -Val
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Setting-jobcontext-attributes-for-jobs-submitted-via-run-call-tp3209p3213.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: Setting jobcontext attributes for jobs submitted via run/call

Posted by vkulichenko <va...@gmail.com>.
Hi Neelesh,

You can inject job context into the closure using annotation:

public class MyGridJob implements IgniteRunnable {
    @JobContextResource
    private ComputeJobContext jobCtx;

    ...
}

Let me know if it works for you.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Setting-jobcontext-attributes-for-jobs-submitted-via-run-call-tp3209p3213.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.