Java 类org.apache.zookeeper.server.TraceFormatter 实例源码

项目:https-github.com-apache-zookeeper    文件:LocalSessionRequestTest.java   
/**
 * Walk through the target peer commmittedLog.
 * @param sessionId
 * @param peerId
 */
private void validateRequestLog(long sessionId, int peerId) {
    String session = Long.toHexString(sessionId);
    LOG.info("Searching for txn of session 0x " + session +
            " on peer " + peerId);
    String peerType = peerId == qb.getLeaderIndex() ? "leader" : "follower";
    QuorumPeer peer = qb.getPeerList().get(peerId);
    ZKDatabase db = peer.getActiveServer().getZKDatabase();
    for (Proposal p : db.getCommittedLog()) {
        Assert.assertFalse("Should not see " +
                           TraceFormatter.op2String(p.request.type) +
                           " request from local session 0x" + session +
                           " on the " + peerType,
                           p.request.sessionId == sessionId);
    }
}
项目:SecureKeeper    文件:LocalSessionRequestTest.java   
/**
 * Walk through the target peer commmittedLog.
 * @param sessionId
 * @param peerId
 */
private void validateRequestLog(long sessionId, int peerId) {
    String session = Long.toHexString(sessionId);
    LOG.info("Searching for txn of session 0x " + session +
            " on peer " + peerId);
    String peerType = peerId == qb.getLeaderIndex() ? "leader" : "follower";
    QuorumPeer peer = qb.getPeerList().get(peerId);
    ZKDatabase db = peer.getActiveServer().getZKDatabase();
    for (Proposal p : db.getCommittedLog()) {
        Assert.assertFalse("Should not see " +
                           TraceFormatter.op2String(p.request.type) +
                           " request from local session 0x" + session +
                           " on the " + peerType,
                           p.request.sessionId == sessionId);
    }
}
项目:SecureKeeper    文件:LocalSessionRequestTest.java   
/**
 * Walk through the target peer commmittedLog.
 * @param sessionId
 * @param peerId
 */
private void validateRequestLog(long sessionId, int peerId) {
    String session = Long.toHexString(sessionId);
    LOG.info("Searching for txn of session 0x " + session +
            " on peer " + peerId);
    String peerType = peerId == qb.getLeaderIndex() ? "leader" : "follower";
    QuorumPeer peer = qb.getPeerList().get(peerId);
    ZKDatabase db = peer.getActiveServer().getZKDatabase();
    for (Proposal p : db.getCommittedLog()) {
        Assert.assertFalse("Should not see " +
                           TraceFormatter.op2String(p.request.type) +
                           " request from local session 0x" + session +
                           " on the " + peerType,
                           p.request.sessionId == sessionId);
    }
}