Package org.apache.flink.runtime.net
Class ConnectionUtils.LeaderConnectingAddressListener
- java.lang.Object
-
- org.apache.flink.runtime.net.ConnectionUtils.LeaderConnectingAddressListener
-
- All Implemented Interfaces:
LeaderRetrievalListener
- Enclosing class:
- ConnectionUtils
public static class ConnectionUtils.LeaderConnectingAddressListener extends Object implements LeaderRetrievalListener
ALeaderRetrievalListenerthat allows retrieving anInetAddressfor the current leader.
-
-
Constructor Summary
Constructors Constructor Description LeaderConnectingAddressListener(org.apache.flink.runtime.rpc.RpcSystemUtils rpcSystemUtils)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InetAddressfindConnectingAddress(Duration timeout)InetAddressfindConnectingAddress(Duration timeout, Duration startLoggingAfter)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
-
findConnectingAddress
public InetAddress findConnectingAddress(Duration timeout) throws LeaderRetrievalException
- Throws:
LeaderRetrievalException
-
findConnectingAddress
public InetAddress findConnectingAddress(Duration timeout, Duration startLoggingAfter) throws LeaderRetrievalException
- Throws:
LeaderRetrievalException
-
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
-
-