本文整理了Java中org.apache.zookeeper.server.ZKDatabase.setlastProcessedZxid()
方法的一些代码示例,展示了ZKDatabase.setlastProcessedZxid()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKDatabase.setlastProcessedZxid()
方法的具体详情如下:
包路径:org.apache.zookeeper.server.ZKDatabase
类名称:ZKDatabase
方法名:setlastProcessedZxid
[英]the last processed zxid in the datatree
[中]数据树中最后处理的zxid
代码示例来源:origin: org.apache.zookeeper/zookeeper
/**
* Start up Leader ZooKeeper server and initialize zxid to the new epoch
*/
private synchronized void startZkServer() {
// Update lastCommitted and Db's zxid to a value representing the new epoch
lastCommitted = zk.getZxid();
LOG.info("Have quorum of supporters, sids: [ "
+ getSidSetString(newLeaderProposal.ackSet)
+ " ]; starting up and setting last processed zxid: 0x{}",
Long.toHexString(zk.getZxid()));
zk.startup();
/*
* Update the election vote here to ensure that all members of the
* ensemble report the same vote to new servers that start up and
* send leader election notifications to the ensemble.
*
* @see https://issues.apache.org/jira/browse/ZOOKEEPER-1732
*/
self.updateElectionVote(getEpoch());
zk.getZKDatabase().setlastProcessedZxid(zk.getZxid());
}
代码示例来源:origin: apache/zookeeper
database.setlastProcessedZxid(2L);
QuorumPeer quorumPeer = mock(QuorumPeer.class);
FileTxnSnapLog logfactory = mock(FileTxnSnapLog.class);
代码示例来源:origin: apache/zookeeper
zk.getZKDatabase().setlastProcessedZxid(zk.getZxid());
代码示例来源:origin: apache/zookeeper
/**
* ZOOKEEPER-1573: test restoring a snapshot with deleted txns ahead of the
* snapshot file's zxid.
*/
@Test
public void testReloadSnapshotWithMissingParent() throws Exception {
// create transactions to create the snapshot with create/delete pattern
ZooKeeper zk = createZKClient(hostPort);
zk.create("/a", "".getBytes(), Ids.OPEN_ACL_UNSAFE,
CreateMode.PERSISTENT);
Stat stat = zk.exists("/a", false);
long createZxId = stat.getMzxid();
zk.create("/a/b", "".getBytes(), Ids.OPEN_ACL_UNSAFE,
CreateMode.PERSISTENT);
zk.delete("/a/b", -1);
zk.delete("/a", -1);
// force the zxid to be behind the content
ZooKeeperServer zks = getServer(serverFactory);
zks.getZKDatabase().setlastProcessedZxid(createZxId);
LOG.info("Set lastProcessedZxid to {}", zks.getZKDatabase()
.getDataTreeLastProcessedZxid());
// Force snapshot and restore
zks.takeSnapshot();
zks.shutdown();
stopServer();
startServer();
}
}
代码示例来源:origin: apache/zookeeper
throw new IOException("Missing signature");
zk.getZKDatabase().setlastProcessedZxid(qp.getZxid());
System.exit(ExitCode.QUORUM_PACKET_ERROR.getValue());
zk.getZKDatabase().setlastProcessedZxid(qp.getZxid());
代码示例来源:origin: org.apache.zookeeper/zookeeper
throw new IOException("Missing signature");
zk.getZKDatabase().setlastProcessedZxid(qp.getZxid());
} else if (qp.getType() == Leader.TRUNC) {
System.exit(13);
zk.getZKDatabase().setlastProcessedZxid(qp.getZxid());
代码示例来源:origin: apache/zookeeper
long eZxid = zks.getZKDatabase().getDataTreeLastProcessedZxid();
zks.getZKDatabase().setlastProcessedZxid(
zks.getZKDatabase().getDataTreeLastProcessedZxid() - 10);
LOG.info("Set lastProcessedZxid to "
代码示例来源:origin: apache/zookeeper
zks.getZKDatabase().setlastProcessedZxid(
zks.getZKDatabase().getDataTreeLastProcessedZxid() - 10);
LOG.info("Set lastProcessedZxid to "
代码示例来源:origin: org.apache.hadoop/zookeeper
zk.getZKDatabase().setlastProcessedZxid(newLeaderZxid);
代码示例来源:origin: org.apache.hadoop/zookeeper
epoch++;
zk.setZxid(epoch << 32L);
zk.getZKDatabase().setlastProcessedZxid(zk.getZxid());
内容来源于网络,如有侵权,请联系作者删除!