flink leaderelectionservice需要处理什么样的争用?

44u64gxh  于 2021-06-21  发布在  Flink
关注(0)|答案(1)|浏览(189)

flink在leaderelectionservice.java中有以下注解
https://github.com/apache/flink/blob/master/flink-runtime/src/main/java/org/apache/flink/runtime/leaderelection/leaderelectionservice.java#l26
这个类打算处理什么样的争用?


* 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.
k2arahey

k2arahey1#

从flink1.8开始,有两个类实现了 LeaderContender 接口。 JobManagerRunner 以及 WebMonitorEndpoint 需要高可用性,并且需要LeaderDirection服务。

public class JobManagerRunner implements LeaderContender, 
                     OnCompletionActions, AutoCloseableAsync {...

public class WebMonitorEndpoint<T extends RestfulGateway> 
    extends RestServerEndpoint implements LeaderContender, JsonArchivist {...

相关问题