Class DefaultDispatcherRunner
java.lang.Object
org.apache.flink.runtime.dispatcher.runner.DefaultDispatcherRunner
- All Implemented Interfaces:
AutoCloseable,DispatcherRunner,LeaderContender,org.apache.flink.util.AutoCloseableAsync
public final class DefaultDispatcherRunner
extends Object
implements DispatcherRunner, LeaderContender
Runner for the
Dispatcher which is responsible for
the leader election.-
Method Summary
Modifier and TypeMethodDescriptionstatic DispatcherRunnercreate(LeaderElection leaderElection, org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler, DispatcherLeaderProcessFactory dispatcherLeaderProcessFactory) Return shut down future of this runner.voidgrantLeadership(UUID leaderSessionID) Callback method which is called by theLeaderElectionServiceupon selecting this instance as the new leader.voidhandleError(Exception exception) Callback method which is called byLeaderElectionServicein case of an error in the service thread.voidCallback method which is called by theLeaderElectionServiceupon revoking the leadership of a former leader.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.util.AutoCloseableAsync
close
-
Method Details
-
getShutDownFuture
Description copied from interface:DispatcherRunnerReturn shut down future of this runner. The shut down future is being completed with the finalApplicationStatusonce the runner wants to shut down.- Specified by:
getShutDownFuturein interfaceDispatcherRunner- Returns:
- future with the final application status
-
closeAsync
- Specified by:
closeAsyncin interfaceorg.apache.flink.util.AutoCloseableAsync
-
grantLeadership
Description copied from interface:LeaderContenderCallback method which is called by theLeaderElectionServiceupon selecting this instance as the new leader. The method is called with the new leader session ID.- Specified by:
grantLeadershipin interfaceLeaderContender- Parameters:
leaderSessionID- New leader session ID
-
revokeLeadership
public void revokeLeadership()Description copied from interface:LeaderContenderCallback method which is called by theLeaderElectionServiceupon revoking the leadership of a former leader. This might happen in case that multiple contenders have been granted leadership.- Specified by:
revokeLeadershipin interfaceLeaderContender
-
handleError
Description copied from interface:LeaderContenderCallback method which is called byLeaderElectionServicein case of an error in the service thread.- Specified by:
handleErrorin interfaceLeaderContender- Parameters:
exception- Caught exception
-
create
public static DispatcherRunner create(LeaderElection leaderElection, org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler, DispatcherLeaderProcessFactory dispatcherLeaderProcessFactory) throws Exception - Throws:
Exception
-