Interface LeaderRetrievalEventHandler
- All Known Implementing Classes:
DefaultLeaderRetrievalService
public interface LeaderRetrievalEventHandler
Interface which should be implemented to notify to
LeaderInformation changes in LeaderRetrievalDriver.
Important: The LeaderRetrievalDriver could not guarantee that there
is no LeaderRetrievalEventHandler callbacks happen after AutoCloseable.close(). This means that the implementor of LeaderRetrievalEventHandler is responsible for filtering out spurious callbacks(e.g. after close
has been called on LeaderRetrievalDriver).
-
Method Summary
Modifier and TypeMethodDescriptionvoidnotifyLeaderAddress(LeaderInformation leaderInformation) Called by specificLeaderRetrievalDriverto notify leader address.
-
Method Details
-
notifyLeaderAddress
Called by specificLeaderRetrievalDriverto notify leader address.Duplicated leader change events could happen, so the implementation should check whether the passed leader information is truly changed with last stored leader information.
- Parameters:
leaderInformation- the new leader information to notifyLeaderRetrievalService. It could beLeaderInformation.empty()if the leader address does not exist in the external storage.
-