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
A
LeaderRetrievalListener that allows retrieving an InetAddress for the
current leader.-
Constructor Summary
ConstructorsConstructorDescriptionLeaderConnectingAddressListener(org.apache.flink.runtime.rpc.RpcSystemUtils rpcSystemUtils) -
Method Summary
Modifier and TypeMethodDescriptionfindConnectingAddress(Duration timeout) findConnectingAddress(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.
-
Constructor Details
-
LeaderConnectingAddressListener
public LeaderConnectingAddressListener(org.apache.flink.runtime.rpc.RpcSystemUtils rpcSystemUtils)
-
-
Method Details
-
findConnectingAddress
- Throws:
LeaderRetrievalException
-
findConnectingAddress
public InetAddress findConnectingAddress(Duration timeout, Duration startLoggingAfter) throws LeaderRetrievalException - Throws:
LeaderRetrievalException
-
notifyLeaderAddress
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
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
-