Package org.apache.flink.runtime.util
Class LeaderRetrievalUtils.LeaderInformationListener
- java.lang.Object
-
- org.apache.flink.runtime.util.LeaderRetrievalUtils.LeaderInformationListener
-
- All Implemented Interfaces:
LeaderRetrievalListener
- Enclosing class:
- LeaderRetrievalUtils
public static class LeaderRetrievalUtils.LeaderInformationListener extends Object implements LeaderRetrievalListener
Helper class which is used by the retrieveLeaderInformation method to retrieve the leader's rpc URL and the current leader session ID.
-
-
Constructor Summary
Constructors Constructor Description LeaderInformationListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<LeaderInformation>getLeaderInformationFuture()voidhandleError(Exception exception)This method is called by theLeaderRetrievalServicein case of an exception.voidnotifyLeaderAddress(String leaderAddress, UUID leaderSessionID)This method is called by theLeaderRetrievalServicewhen a new leader is elected.
-
-
-
Method Detail
-
getLeaderInformationFuture
public CompletableFuture<LeaderInformation> getLeaderInformationFuture()
-
notifyLeaderAddress
public void notifyLeaderAddress(String leaderAddress, UUID leaderSessionID)
Description copied from interface:LeaderRetrievalListenerThis method is called by theLeaderRetrievalServicewhen a new leader is elected.If both arguments are null then it signals that leadership was revoked without a new leader having been elected.
- Specified by:
notifyLeaderAddressin interfaceLeaderRetrievalListener- Parameters:
leaderAddress- The address of the new leaderleaderSessionID- The new leader session ID
-
handleError
public void handleError(Exception exception)
Description copied from interface:LeaderRetrievalListenerThis method is called by theLeaderRetrievalServicein case of an exception. This assures that theLeaderRetrievalListeneris aware of any problems occurring in theLeaderRetrievalServicethread.- Specified by:
handleErrorin interfaceLeaderRetrievalListener
-
-