]
Vladimir Blagojevic updated ISPN-1974:
--------------------------------------
Git Pull Request:
)
Component/s: Distributed Execution and Map/Reduce
(was: Core API)
Add <T> Future<T> submit(Address target,
Callable<T> task) at least to DefaultExecutorService
---------------------------------------------------------------------------------------------
Key: ISPN-1974
URL:
https://issues.jboss.org/browse/ISPN-1974
Project: Infinispan
Issue Type: Enhancement
Components: Distributed Execution and Map/Reduce
Affects Versions: 5.1.3.FINAL
Reporter: Thomas Fromm
Assignee: Vladimir Blagojevic
Fix For: 5.2.0.ALPHA1, 5.2.0.Final
To easy execute tasks on specific nodes I'd like to have an additional method at
DefaultExecutorService:
{code}
public <T> Future<T> submit(Address target, Callable<T> task){
if (task == null) throw new NullPointerException();
if (target == null) throw new NullPointerException();
List<Address> members = rpc.getTransport().getMembers();
if(!members.contains(target)){
throw new IllegalArgumentException("Unknown node
"+target.toString());
}
Address me = rpc.getAddress();
DistributedExecuteCommand<T> c = null;
if(target.equals(me)){
c = factory.buildDistributedExecuteCommand(clone(task), me, null);
} else {
c = factory.buildDistributedExecuteCommand(task, me, null);
}
DistributedRunnableFuture<T> f = new
DistributedRunnableFuture<T>(c);
executeFuture(target, f);
return f;
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: