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(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(Configuration configuration) throws Exception
LeaderRetrievalService
based on the provided Configuration
object.configuration
- Configuration containing the settings for the LeaderRetrievalService
LeaderRetrievalService
specified in the configuration objectException
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, 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 InetAddress findConnectingAddress(LeaderRetrievalService leaderRetrievalService, scala.concurrent.duration.FiniteDuration timeout) throws LeaderRetrievalException
LeaderRetrievalException
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.