public class StandaloneLeaderRetrievalService extends Object implements LeaderRetrievalService
LeaderRetrievalService
. This implementation assumes that
there is only a single contender for leadership (e.g., a single JobManager or ResourceManager
process) and that this process is reachable under a constant address.
As soon as this service is started, it immediately notifies the leader listener of the leader contender with the pre-configured address.
Constructor and Description |
---|
StandaloneLeaderRetrievalService(String leaderAddress)
Deprecated.
Use
StandaloneLeaderRetrievalService(String, UUID) instead |
StandaloneLeaderRetrievalService(String leaderAddress,
UUID leaderId)
Creates a StandaloneLeaderRetrievalService with the given leader address.
|
Modifier and Type | Method and Description |
---|---|
void |
start(LeaderRetrievalListener listener)
Starts the leader retrieval service with the given listener to listen for new leaders.
|
void |
stop()
Stops the leader retrieval service.
|
@Deprecated public StandaloneLeaderRetrievalService(String leaderAddress)
StandaloneLeaderRetrievalService(String, UUID)
insteadleaderAddress
- The leader's pre-configured addresspublic void start(LeaderRetrievalListener listener)
LeaderRetrievalService
start
in interface LeaderRetrievalService
listener
- The leader retrieval listener which will be notified about new leaders.public void stop()
LeaderRetrievalService
stop
in interface LeaderRetrievalService
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.