LeaderElectionEventHandler
will be replaced by MultipleComponentLeaderElectionDriver.Listener
.@Deprecated @NotThreadSafe public interface LeaderElectionEventHandler
LeaderElectionDriver
.
Important: The LeaderElectionDriver
could not guarantee that there is
no LeaderElectionEventHandler
callbacks happen after AutoCloseable.close()
. This means that the implementor of LeaderElectionEventHandler
is responsible for filtering out spurious callbacks(e.g. after close
has been called on LeaderElectionDriver
).
The order of events matters. Therefore, calling event processing functions of this interface should happen in a single-thread environment.
Modifier and Type | Method and Description |
---|---|
void |
onGrantLeadership(UUID newLeaderSessionId)
Deprecated.
|
void |
onLeaderInformationChange(LeaderInformation leaderInformation)
Deprecated.
|
void |
onRevokeLeadership()
Deprecated.
|
@Deprecated void onGrantLeadership(UUID newLeaderSessionId)
LeaderElectionDriver
when the leadership is granted.newLeaderSessionId
- the valid leader session id@Deprecated void onRevokeLeadership()
LeaderElectionDriver
when the leadership is revoked. Updating the
LeaderElection data at this point doesn't have any effect anymore.@Deprecated void onLeaderInformationChange(LeaderInformation leaderInformation)
LeaderElectionDriver
when the leader information is changed. Then
the LeaderElectionService
could write the leader information again if necessary. This
method should only be called when LeaderElectionDriver.hasLeadership()
is true.
Duplicated leader change events could happen, so the implementation should check whether the
passed leader information is really different with internal confirmed leader information.leaderInformation
- leader information which contains leader session id and leader
address.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.