一、前言
前面分析了LeaderZooKeeperServer,接著分析FollowerZooKeeperServer。
二、FollowerZooKeeperServer源碼分析
2.1 類的繼承關(guān)系
public class FollowerZooKeeperServer extends LearnerZooKeeperServer {}
說(shuō)明:其繼承LearnerZooKeeperServer抽象類,角色為Follower。其請(qǐng)求處理鏈為FollowerRequestProcessor -> CommitProcessor -> FinalRequestProcessor。
2.2 類的屬性
public class FollowerZooKeeperServer extends LearnerZooKeeperServer { private static final Logger LOG = LoggerFactory.getLogger(FollowerZooKeeperServer.class); // 提交請(qǐng)求處理器 CommitProcessor commitProcessor; // 同步請(qǐng)求處理器 SyncRequestProcessor syncProcessor; /* * Pending sync requests */ // 待同步請(qǐng)求 ConcurrentLinkedQueue<Request> pendingSyncs; // 待處理的事務(wù)請(qǐng)求 LinkedBlockingQueue<Request> pendingTxns = new LinkedBlockingQueue<Request>(); }
延伸閱讀
- ssh框架 2016-09-30
- 阿里移動(dòng)安全 [無(wú)線安全]玩轉(zhuǎn)無(wú)線電——不安全的藍(lán)牙鎖 2017-07-26
- 消息隊(duì)列NetMQ 原理分析4-Socket、Session、Option和Pipe 2024-03-26
- Selective Search for Object Recognition 論文筆記【圖片目標(biāo)分割】 2017-07-26
- 詞向量-LRWE模型-更好地識(shí)別反義詞同義詞 2017-07-26
- 從棧不平衡問(wèn)題 理解 calling convention 2017-07-26
- php imagemagick 處理 圖片剪切、壓縮、合并、插入文本、背景色透明 2017-07-26
- Swift實(shí)現(xiàn)JSON轉(zhuǎn)Model - HandyJSON使用講解 2017-07-26
- 阿里移動(dòng)安全 Android端惡意鎖屏勒索應(yīng)用分析 2017-07-26
- 集合結(jié)合數(shù)據(jù)結(jié)構(gòu)來(lái)看看(二) 2017-07-26
