Flink在LeaderElectionService.java中有以下评论
此类打算处理哪种争用?
* Interface for a service which allows to elect a leader among
a group of contenders.
* Prior to using this service, it has to be started calling
the start method. The start method
* takes the contender as a parameter. If there are multiple
contenders, then each contender has
* to instantiate its own leader election service.
答案 0 :(得分:0)
从Flink 1.8开始,有两个类实现LeaderContender
接口。
JobManagerRunner
和WebMonitorEndpoint
需要高可用性,并需要LeaderElectionService。
public class JobManagerRunner implements LeaderContender,
OnCompletionActions, AutoCloseableAsync {...
public class WebMonitorEndpoint<T extends RestfulGateway>
extends RestServerEndpoint implements LeaderContender, JsonArchivist {...