public class KetaLeaderElector extends Object implements LeaderElector, Closeable
| Constructor and Description |
|---|
KetaLeaderElector(KetaConfig config,
KetaEngine engine,
GrpcProxy<byte[],byte[]> proxy) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
KetaIdentity |
getIdentity() |
int |
getLeaderId() |
List<URI> |
getListeners() |
int |
getMemberId() |
Collection<KetaIdentity> |
getMembers() |
void |
init() |
boolean |
isLeader() |
void |
onAssigned(KetaProtocol.Assignment assignment,
int generation)
Invoked when a new assignment is created by joining the group.
|
void |
onRevoked()
Invoked when a rebalance operation starts, revoking leadership
|
public KetaLeaderElector(KetaConfig config, KetaEngine engine, GrpcProxy<byte[],byte[]> proxy) throws KetaElectionException
KetaElectionExceptionpublic void init()
throws KetaElectionException
KetaElectionExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic void onAssigned(KetaProtocol.Assignment assignment, int generation)
public void onRevoked()
public KetaIdentity getIdentity()
public int getMemberId()
public boolean isLeader()
isLeader in interface LeaderElectorpublic int getLeaderId()
public Collection<KetaIdentity> getMembers()
Copyright © 2021. All rights reserved.