Executor service

15 views
Skip to first unread message

Joan Balagueró

unread,
Mar 18, 2010, 11:16:38 AM3/18/10
to Hazelcast
Hello,

I'm trying to make a distributed execution to all members of cluster.
The idea is to get the free disk space on each node.

ExecutorService es = this.hz.getExecutorService();
MultiTask<Boolean> task = new MultiTask<Boolean>(new
MonitorDiskSpaceTask(), this.getMembers());
es.execute(task);

ArrayList<Integer> = task.get();

Let's suppose I send this execution to 4 members. Then, 3 of them
return OK but one of them throws an exception. I should show the
following:

Node1 135 Mb.
Node2 223Mb.
Node3 ---- -> this is the node that failed
Node4 760 Mb.

As Talip says in the documentation, MultiTask.get() will throw
java.util.concurrent.ExecutionException if any of the executions
throws exception. With that in mind, if a member fails I cannot get
any result (even from the nodes where the execution goes well).

is there any way to achieve this?

Thanks,
Joan.

Fuad Malikov

unread,
Mar 26, 2010, 4:20:23 AM3/26/10
to haze...@googlegroups.com
Hi,

Sorry for late response. 

Are you saying that execution on one of the members throws Exception?
You could actually do it in a different way. Instead of submitting MultiTask to a set of members, you can submit a distributed task to each member separately.
As of today this approach will work. 

But getting the partial result set from MultiTask is not available right now. 
However it seems doable. We need to extend the MultiTask API. 
Could you please create an issue for this.

-Fuad

Wojciech Durczyński

unread,
Apr 16, 2010, 10:09:28 AM4/16/10
to Hazelcast
+1 for getting partial result set from MultiTask
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To post to this group, send email to haze...@googlegroups.com.
To unsubscribe from this group, send email to hazelcast+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hazelcast?hl=en.

Wojciech Durczyński

unread,
May 5, 2010, 11:16:11 AM5/5/10
to Hazelcast
Issue created:
http://code.google.com/p/hazelcast/issues/detail?id=264

On 16 Kwi, 16:09, Wojciech Durczyński
Reply all
Reply to author
Forward
0 new messages