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
ALeaderRetrievalListener
that allows retrieving anInetAddress
for the current leader.
-
-
Constructor Summary
Constructors Constructor Description LeaderConnectingAddressListener(RpcSystemUtils rpcSystemUtils)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InetAddress
findConnectingAddress(Duration timeout)
InetAddress
findConnectingAddress(Duration timeout, Duration startLoggingAfter)
void
handleError(Exception exception)
This method is called by theLeaderRetrievalService
in case of an exception.void
notifyLeaderAddress(String leaderAddress, UUID leaderSessionID)
This method is called by theLeaderRetrievalService
when a new leader is elected.
-
-
-
Constructor Detail
-
LeaderConnectingAddressListener
public LeaderConnectingAddressListener(RpcSystemUtils rpcSystemUtils)
-
-
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:LeaderRetrievalListener
This method is called by theLeaderRetrievalService
when 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:
notifyLeaderAddress
in interfaceLeaderRetrievalListener
- Parameters:
leaderAddress
- The address of the new leaderleaderSessionID
- The new leader session ID
-
handleError
public void handleError(Exception exception)
Description copied from interface:LeaderRetrievalListener
This method is called by theLeaderRetrievalService
in case of an exception. This assures that theLeaderRetrievalListener
is aware of any problems occurring in theLeaderRetrievalService
thread.- Specified by:
handleError
in interfaceLeaderRetrievalListener
-
-