Hi Azeez,

For the tasks functionality, at the moment, we have our own implementation
on top of Hazelcast, since we require some additional functionality than
the simple scenario. The idea was I guess, to build that functionality on
top of this, but the direct implementation for the moment is more straight
forward. For example, the task implementation currently can have multiple
coordinators according to different task types, this is because a single
node can be hosting tasks for many tasks types and another may only contain
a different task type and so on. So we will see probably in the future, if
we can migrate to this, by possibly implementing any missing functionality.

Cheers,
Anjana.


On Tue, Apr 1, 2014 at 1:52 PM, Afkham Azeez <[email protected]> wrote:

> We have had this requirement for having a single coordinator per cluster,
> and I have come up with a simple implementation. I am using a Hazlecast
> lock for this. The member who acquires this lock becomes the coordinator.
> In the event of the coordinator crashing, another member will acquire that
> lock, and will become the new coordinator. When a new member becomes the
> coordinator, then it may need to do certain things. For example, the tasks
> component may need to take over execution of tasks. In order to notify such
> components about this member becoming the coordinator, I have introduced an
> interface called CoordinatedActivity with a single method called execute.
> If you wish to be notified when this member becomes the coordinator, you
> need to register an OSGi service which implements that interface.
>
> In addtion, the ClusteringAgent also has a method named isCoordinator and
> if your code wishes to check whether this member is the coordinator before
> executing certain things, you can call that method.
>
> The code is available in the feature branch
> https://github.com/wso2/carbon-kernel/tree/cluster-coordinator-feature
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * <http://www.apache.org/>*
> *email: **[email protected]* <[email protected]>
> * cell: +94 77 3320919 <%2B94%2077%203320919> blog: *
> *http://blog.afkham.org* <http://blog.afkham.org>
> *twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
> * linked-in: **http://lk.linkedin.com/in/afkhamazeez
> <http://lk.linkedin.com/in/afkhamazeez>*
>
> *Lean . Enterprise . Middleware*
>



-- 
*Anjana Fernando*
Technical Lead
WSO2 Inc. | http://wso2.com
lean . enterprise . middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to