public final class DefaultDispatcherRunner extends Object implements DispatcherRunner, LeaderContender
Dispatcher which is responsible for
the leader election.| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
closeAsync() |
static DispatcherRunner |
create(LeaderElectionService leaderElectionService,
org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler,
DispatcherLeaderProcessFactory dispatcherLeaderProcessFactory) |
CompletableFuture<ApplicationStatus> |
getShutDownFuture()
Return shut down future of this runner.
|
void |
grantLeadership(UUID leaderSessionID)
Callback method which is called by the
LeaderElectionService upon selecting this
instance as the new leader. |
void |
handleError(Exception exception)
Callback method which is called by
LeaderElectionService in case of an error in the
service thread. |
void |
revokeLeadership()
Callback method which is called by the
LeaderElectionService upon revoking the
leadership of a former leader. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDescriptionpublic CompletableFuture<ApplicationStatus> getShutDownFuture()
DispatcherRunnerApplicationStatus once the runner wants to shut down.getShutDownFuture in interface DispatcherRunnerpublic CompletableFuture<Void> closeAsync()
closeAsync in interface org.apache.flink.util.AutoCloseableAsyncpublic void grantLeadership(UUID leaderSessionID)
LeaderContenderLeaderElectionService upon selecting this
instance as the new leader. The method is called with the new leader session ID.grantLeadership in interface LeaderContenderleaderSessionID - New leader session IDpublic void revokeLeadership()
LeaderContenderLeaderElectionService upon revoking the
leadership of a former leader. This might happen in case that multiple contenders have been
granted leadership.revokeLeadership in interface LeaderContenderpublic void handleError(Exception exception)
LeaderContenderLeaderElectionService in case of an error in the
service thread.handleError in interface LeaderContenderexception - Caught exceptionpublic static DispatcherRunner create(LeaderElectionService leaderElectionService, org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler, DispatcherLeaderProcessFactory dispatcherLeaderProcessFactory) throws Exception
ExceptionCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.