ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anil <anilk...@gmail.com>
Subject Re: Running a IgniteRunnable on local node using compute
Date Tue, 07 Mar 2017 11:24:33 GMT
sorry. that was incomplete email. that is working.

On 7 March 2017 at 16:49, Andrey Mashenkov <amashenkov@gridgain.com> wrote:

> Hi Anil,
>
> Do you mean this is not work for you?
>
> new IgniteRunnable() {
>       @IgniteInstanceResource
>       Ignite ignite;
> @Override
> public void run() {
>
> ignite....
>
>         }
> }
>
>
>
>
>
> On Tue, Mar 7, 2017 at 8:43 AM, Anil <anilklce@gmail.com> wrote:
>
>>
>> ignite.compute(ignite..cluster().forLocal()).run() will run the ignite
>> runnble on local node.
>>
>> final pseudo code -
>>
>> ignite.compute().broadcast(new IgniteRunnable() {
>> @Override
>> public void run() {
>>
>> Observable<Long> o = Observable.timer(((CommonUtils.getCurrentDayTime()
>> + 24 * 60 * 60 * 1000) - System.currentTimeMillis()), 24 * 60 * 60 * 1000, TimeUnit.MILLISECONDS,
>> scheduler);
>> o.subscribe(item -> {
>> ignite.compute(ignite..cluster().forLocal()).run(new
>> IgniteRunnableTask());
>> });
>> }
>> });
>>
>>
>>
>> On 7 March 2017 at 10:23, Anil <anilklce@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Are there any settings to use ignite.compute().run() to run the task on
>>> local node ?
>>>
>>> i am try to schedule the task on each node using Rx Scheduler. so I am
>>> broadcasting a runnable which initiates the scheduler on each node.
>>>
>>> As I know, we cannot run a task on local node using
>>> ignite.compute().run(). this will run the task on one of the nodes. correct
>>> ?
>>>
>>> we can start the thread for runnable instance and this will run the task
>>> on local node. Bu this cannot inject ignite instance into runnable instance.
>>>
>>> Do you have any suggestions to achieve this ?
>>>
>>> Thanks
>>>
>>>
>>>
>>
>

Mime
View raw message