QuorumDigestAuthTest.java 文件源码

java
阅读 40 收藏 0 点赞 0 评论 0

项目:ZooKeeper 作者:
private void shutdownQP(QuorumPeer qp) throws InterruptedException {
    assertNotNull("QuorumPeer doesn't exist!", qp);
    qp.shutdown();

    int retryCnt = 30;
    while (retryCnt > 0) {
        if (qp.getPeerState() == ServerState.LOOKING) {
            LOG.info("Number of retries:{} to change the server state to {}",
                    retryCnt, ServerState.LOOKING);
            break;
        }
        Thread.sleep(500);
        retryCnt--;
    }
    Assert.assertEquals(
            "After shutdown, QuorumPeer should change its state to LOOKING",
            ServerState.LOOKING, qp.getPeerState());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号