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 InetAddress |
findConnectingAddress(LeaderRetrievalService leaderRetrievalService,
scala.concurrent.duration.FiniteDuration timeout) |
static InetAddress |
findConnectingAddress(LeaderRetrievalService leaderRetrievalService,
Time timeout) |
static HighAvailabilityMode |
getRecoveryMode(Configuration config)
Gets the recovery mode as configured, based on
HighAvailabilityOptions.HA_MODE . |
static LeaderConnectionInfo |
retrieveLeaderConnectionInfo(LeaderRetrievalService leaderRetrievalService,
scala.concurrent.duration.FiniteDuration timeout)
Retrieves the leader akka url and the current leader session ID.
|
static LeaderConnectionInfo |
retrieveLeaderConnectionInfo(LeaderRetrievalService leaderRetrievalService,
Time 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 . |
static UUID |
retrieveLeaderSessionId(LeaderRetrievalService leaderRetrievalService,
scala.concurrent.duration.FiniteDuration timeout)
Retrieves the current leader session id of the component identified by the given leader
retrieval service.
|
public 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, Time timeout) throws LeaderRetrievalException
LeaderConnectionInfo
instance.leaderRetrievalService
- Leader retrieval service to retrieve the leader connection
informationtimeout
- Timeout when to give up looking for the leaderLeaderRetrievalException
public 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 leaderLeaderRetrievalException
public static UUID retrieveLeaderSessionId(LeaderRetrievalService leaderRetrievalService, scala.concurrent.duration.FiniteDuration timeout) throws LeaderRetrievalException
leaderRetrievalService
- Leader retrieval service to be used for the leader retrievaltimeout
- Timeout for the leader retrievalLeaderRetrievalException
- if the leader retrieval operation fails (including a timeout)public static InetAddress findConnectingAddress(LeaderRetrievalService leaderRetrievalService, Time timeout) throws LeaderRetrievalException
LeaderRetrievalException
public static InetAddress findConnectingAddress(LeaderRetrievalService leaderRetrievalService, scala.concurrent.duration.FiniteDuration timeout) throws LeaderRetrievalException
LeaderRetrievalException
public static HighAvailabilityMode getRecoveryMode(Configuration config)
HighAvailabilityOptions.HA_MODE
.config
- The configuration to read the recovery mode from.IllegalConfigurationException
- Thrown, if the recovery mode does not correspond
to a known value.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.