org.apache.zookeeper.server.ZKDatabase.getCommittedLog()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中org.apache.zookeeper.server.ZKDatabase.getCommittedLog()方法的一些代码示例,展示了ZKDatabase.getCommittedLog()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKDatabase.getCommittedLog()方法的具体详情如下:
包路径:org.apache.zookeeper.server.ZKDatabase
类名称:ZKDatabase
方法名:getCommittedLog

ZKDatabase.getCommittedLog介绍

暂无

代码示例

代码示例来源:origin: apache/zookeeper

Long.toHexString(peerLastZxid));
if (db.getCommittedLog().isEmpty()) {
  Iterator<Proposal> itr = db.getCommittedLog().iterator();
  currentZxid = queueCommittedProposals(itr, peerLastZxid,
                     null, maxCommittedLog);
    Iterator<Proposal> committedLogItr = db.getCommittedLog().iterator();
    currentZxid = queueCommittedProposals(committedLogItr, currentZxid,
                       null, maxCommittedLog);

代码示例来源:origin: apache/zookeeper

/**
 * 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);
  }
}

代码示例来源:origin: org.apache.zookeeper/zookeeper

+" peerLastZxid=0x"+Long.toHexString(peerLastZxid));
LinkedList<Proposal> proposals = leader.zk.getZKDatabase().getCommittedLog();

代码示例来源:origin: apache/zookeeper

List<Proposal> committedLog = zks.getZKDatabase().getCommittedLog();
int logsize = committedLog.size();
LOG.info("committedLog size = {}", logsize);

代码示例来源:origin: org.apache.hadoop/zookeeper

LinkedList<Proposal> proposals = leader.zk.getZKDatabase().getCommittedLog();
synchronized(proposals) {
  if (proposals.size() != 0) {

相关文章