public class LeaderRetrievalUtils extends Object
LeaderRetrievalService class.| Modifier and Type | Class and Description |
|---|---|
static class |
LeaderRetrievalUtils.LeaderConnectionInfoListener
Helper class which is used by the retrieveLeaderConnectionInfo method to retrieve the
leader's akka URL and the current leader session ID.
|
static class |
LeaderRetrievalUtils.LeaderGatewayListener
Helper class which is used by the retrieveLeaderGateway method as the
LeaderRetrievalListener. |
| Modifier and Type | Method and Description |
|---|---|
static LeaderRetrievalService |
createLeaderRetrievalService(org.apache.flink.configuration.Configuration configuration)
Creates a
LeaderRetrievalService based on the provided Configuration object. |
static InetAddress |
findConnectingAddress(LeaderRetrievalService leaderRetrievalService,
scala.concurrent.duration.FiniteDuration timeout) |
static LeaderConnectionInfo |
retrieveLeaderConnectionInfo(LeaderRetrievalService leaderRetrievalService,
scala.concurrent.duration.FiniteDuration timeout)
Retrieves the leader akka url and the current leader session ID.
|
static ActorGateway |
retrieveLeaderGateway(LeaderRetrievalService leaderRetrievalService,
akka.actor.ActorSystem actorSystem,
scala.concurrent.duration.FiniteDuration timeout)
Retrieves the current leader gateway using the given
LeaderRetrievalService. |
public static LeaderRetrievalService createLeaderRetrievalService(org.apache.flink.configuration.Configuration configuration) throws Exception
LeaderRetrievalService based on the provided Configuration object.configuration - Configuration containing the settings for the LeaderRetrievalServiceLeaderRetrievalService specified in the configuration objectExceptionpublic static ActorGateway retrieveLeaderGateway(LeaderRetrievalService leaderRetrievalService, akka.actor.ActorSystem actorSystem, scala.concurrent.duration.FiniteDuration timeout) throws LeaderRetrievalException
LeaderRetrievalService. If the
current leader could not be retrieved after the given timeout, then a
LeaderRetrievalException is thrown.leaderRetrievalService - LeaderRetrievalService which is used for the leader retrievalactorSystem - ActorSystem which is used for the LeaderRetrievalListener implementationtimeout - Timeout value for the retrieval callLeaderRetrievalException - If the actor gateway could not be retrieved or the timeout has been exceededpublic static LeaderConnectionInfo retrieveLeaderConnectionInfo(LeaderRetrievalService leaderRetrievalService, scala.concurrent.duration.FiniteDuration timeout) throws LeaderRetrievalException
LeaderConnectionInfo instance.leaderRetrievalService - Leader retrieval service to retrieve the leader connection
informationtimeout - Timeout when to give up looking for the leaderLeaderRetrievalExceptionpublic static InetAddress findConnectingAddress(LeaderRetrievalService leaderRetrievalService, scala.concurrent.duration.FiniteDuration timeout) throws LeaderRetrievalException
LeaderRetrievalExceptionCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.