public class OneTimeLeaderListenerFuture extends Object implements LeaderRetrievalListener
The future can be obtained via the future()
method.
Constructor and Description |
---|
OneTimeLeaderListenerFuture() |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<LeaderAddressAndId> |
future()
Gets the future that is completed with the leader address and ID.
|
void |
handleError(Exception exception)
This method is called by the
LeaderRetrievalService in case of an exception. |
void |
notifyLeaderAddress(String leaderAddress,
UUID leaderSessionID)
This method is called by the
LeaderRetrievalService when a new leader is elected. |
public CompletableFuture<LeaderAddressAndId> future()
public void notifyLeaderAddress(String leaderAddress, UUID leaderSessionID)
LeaderRetrievalListener
LeaderRetrievalService
when a new leader is elected.notifyLeaderAddress
in interface LeaderRetrievalListener
leaderAddress
- The address of the new leaderleaderSessionID
- The new leader session IDpublic void handleError(Exception exception)
LeaderRetrievalListener
LeaderRetrievalService
in case of an exception. This
assures that the LeaderRetrievalListener
is aware of any problems occurring in the
LeaderRetrievalService
thread.handleError
in interface LeaderRetrievalListener
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.