189 8069 5689

如何解析zk中的ToBeAppliedRequestProcessor

这期内容当中小编将会给大家带来有关如何解析zk中的ToBeAppliedRequestProcessor,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。

创新互联专注为客户提供全方位的互联网综合服务,包含不限于成都做网站、网站建设、江达网络推广、小程序开发、江达网络营销、江达企业策划、江达品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联为所有大学生创业者提供江达建站搭建服务,24小时服务热线:13518219792,官方网址:www.cdcxhl.com

ToBeAppliedRequestProcessor在Leader中

在已处理事务和最后处理事务处理器之间,处理器链上下一个是FinalRequestProcessor

public void processRequest(Request request) throws RequestProcessorException {
    next.processRequest(request);

    // The only requests that should be on toBeApplied are write
    // requests, for which we will have a hdr. We can't simply use
    // request.zxid here because that is set on read requests to equal
    // the zxid of the last write op.
    if (request.getHdr() != null) {
        long zxid = request.getHdr().getZxid();
        Iterator iter = leader.toBeApplied.iterator();
        if (iter.hasNext()) {
            Proposal p = iter.next();
            if (p.request != null && p.request.zxid == zxid) {
                iter.remove();
                return;
            }
        }
        LOG.error("Committed request not found on toBeApplied: " + request);
    }
}

上述就是小编为大家分享的如何解析zk中的ToBeAppliedRequestProcessor了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注创新互联行业资讯频道。


分享题目:如何解析zk中的ToBeAppliedRequestProcessor
URL网址:http://cdxtjz.cn/article/phojoe.html

其他资讯