Package org.apache.flink.runtime.util
Class LeaderRetrievalUtils
- java.lang.Object
-
- org.apache.flink.runtime.util.LeaderRetrievalUtils
-
public class LeaderRetrievalUtils extends Object
Utility class to work withLeaderRetrievalService
class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LeaderRetrievalUtils.LeaderInformationListener
Helper class which is used by the retrieveLeaderInformation method to retrieve the leader's rpc URL and the current leader session ID.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static InetAddress
findConnectingAddress(LeaderRetrievalService leaderRetrievalService, Duration timeout, RpcSystemUtils rpcSystemUtils)
static LeaderInformation
retrieveLeaderInformation(LeaderRetrievalService leaderRetrievalService, Duration timeout)
Retrieves the leader pekko url and the current leader session ID.
-
-
-
Method Detail
-
retrieveLeaderInformation
public static LeaderInformation retrieveLeaderInformation(LeaderRetrievalService leaderRetrievalService, Duration timeout) throws LeaderRetrievalException
Retrieves the leader pekko url and the current leader session ID. The values are stored in aLeaderInformation
instance.- Parameters:
leaderRetrievalService
- Leader retrieval service to retrieve the leader connection informationtimeout
- Timeout when to give up looking for the leader- Returns:
- LeaderInformation containing the leader's rpc URL and the current leader session ID
- Throws:
LeaderRetrievalException
-
findConnectingAddress
public static InetAddress findConnectingAddress(LeaderRetrievalService leaderRetrievalService, Duration timeout, RpcSystemUtils rpcSystemUtils) throws LeaderRetrievalException
- Throws:
LeaderRetrievalException
-
-