curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cameron McKenzie <mckenzie....@gmail.com>
Subject Re: Find current group leader
Date Sun, 26 Oct 2014 22:09:50 GMT
hey Ricardo,
You're using the LeaderLatch recipe?

There should be a getLeader() method exposed by the LeaderLatch which you
can use to determine the current leader.
cheers
Cam

On Mon, Oct 27, 2014 at 9:04 AM, Ricardo Ferreira <ricardojsfer@gmail.com>
wrote:

> Hi,
>
> I'm using the Leader Election recipe to manage leadership among some of my
> nodes.
>
> However, I need to find out the current leader of these nodes from another
> client which is not
> part of the same group.
>
> I haven't found anything on the API to do this. So what's done is to
> instantiate a new LeaderSelector
> and a dummy LeaderSelectorListener that relinquishes leadership as soon as
> it gets it (just in case).
> From this LeaderSelector I can find the ID of the group leader. Then I'll
> query ServiceDiscovery for
> the instance corresponding to this ID.
>
> Is there a simpler (or better) way to this?
>

Mime
View raw message