ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christos Erotocritou <chris...@gridgain.com>
Subject Re: Introduce custom executors for compute grid
Date Tue, 18 Apr 2017 15:00:08 GMT
Thanks Taras, this will be very handy.

I assume its not currently possible to constrain an executor pool to be started only on a
specific node?

C.

> On 18 Apr 2017, at 15:55, Denis Magda <dmagda@apache.org> wrote:
> 
> Taras, that’s an excellent addition to the project!
> 
> Please don’t forget to document it: https://issues.apache.org/jira/browse/IGNITE-4969
<https://issues.apache.org/jira/browse/IGNITE-4969>
> 
> —
> Denis
> 
>> On Apr 18, 2017, at 1:23 AM, Taras Ledkov <tledkov@gridgain.com> wrote:
>> 
>> Igniters,
>> 
>> Custom executor (user's thread pool) is added fro compute grid with following semantics:
>> 
>> 1. Configuration:
>> 
>> IgniteConfiguration cfg;
>> ...
>> cfg.setExecutorConfiguration(
>>   new ExecutorConfiguration().setName("executor0").setSize(2),
>>   new ExecutorConfiguration().setName("executor1").setSize(4));
>> 
>> Where
>> name - name of executor and thread pool;
>> size - thread pool size.
>> 
>> 2. Usage:
>> 
>> Ignite ignite;
>> ...
>> IgniteCompute comp = ignite.compute().withExecutor("executor0");
>> comp.broadcast(new IgniteRunnable() {
>>           @Override public void run() {
>>            ...
>>           }
>>       });
>> 
>> So, 'withExecutor(String)' returns the compute associated with custom named executor.
>> All jobs submitted by the components will be processed by thread pool corresponds
to named executor.
>> If the executor isn't configured on the target host the warning will be printed in
the log and a job will be processed in the public pool.
>> e.g.:
>> [11:20:01,023][WARN ][grid-nio-worker-tcp-comm-0-#27%compute.IgniteComputeCustomExecutorSelfTest1%][GridIoManager]
Custom executor 'invalid' doesn't exist. The job will be submit to public pool: b2e85208b51-4fbcb569-07a2-480e-9be1-512bc3200000
>> 
>> Issue: https://issues.apache.org/jira/browse/IGNITE-4699
>> 
>> Please share your thoughts or ask questions.
>> 
>> -- 
>> Taras Ledkov
>> Mail-To: tledkov@gridgain.com
>> 
> 


Mime
View raw message