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 withLeaderRetrievalServiceclass.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLeaderRetrievalUtils.LeaderInformationListenerHelper 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 InetAddressfindConnectingAddress(LeaderRetrievalService leaderRetrievalService, Duration timeout, org.apache.flink.runtime.rpc.RpcSystemUtils rpcSystemUtils)static LeaderInformationretrieveLeaderInformation(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 aLeaderInformationinstance.- 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, org.apache.flink.runtime.rpc.RpcSystemUtils rpcSystemUtils) throws LeaderRetrievalException
- Throws:
LeaderRetrievalException
-
-