- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.getDataTree()
方法的一些代码示例,展示了ZKDatabase.getDataTree()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKDatabase.getDataTree()
方法的具体详情如下:
包路径:org.apache.zookeeper.server.ZKDatabase
类名称:ZKDatabase
方法名:getDataTree
[英]the datatree for this zkdatabase
[中]此数据库的数据树
代码示例来源:origin: apache/zookeeper
/**
* serialize the snapshot
* @param oa the output archive to which the snapshot needs to be serialized
* @throws IOException
* @throws InterruptedException
*/
public void serializeSnapshot(OutputArchive oa) throws IOException,
InterruptedException {
SerializeUtils.serializeSnapshot(getDataTree(), oa, getSessionWithTimeOuts());
}
代码示例来源:origin: org.apache.zookeeper/zookeeper
public void takeSnapshot(){
try {
txnLogFactory.save(zkDb.getDataTree(), zkDb.getSessionWithTimeOuts());
} catch (IOException e) {
LOG.error("Severe unrecoverable error, exiting", e);
// This is a severe error that we cannot recover from,
// so we need to exit
System.exit(10);
}
}
代码示例来源:origin: org.apache.zookeeper/zookeeper
/**
* serialize the snapshot
* @param oa the output archive to which the snapshot needs to be serialized
* @throws IOException
* @throws InterruptedException
*/
public void serializeSnapshot(OutputArchive oa) throws IOException,
InterruptedException {
SerializeUtils.serializeSnapshot(getDataTree(), oa, getSessionWithTimeOuts());
}
代码示例来源:origin: apache/zookeeper
/**
* deserialize a snapshot from an input archive
* @param ia the input archive you want to deserialize from
* @throws IOException
*/
public void deserializeSnapshot(InputArchive ia) throws IOException {
clear();
SerializeUtils.deserializeSnapshot(getDataTree(),ia,getSessionWithTimeOuts());
initialized = true;
}
代码示例来源:origin: apache/zookeeper
@Override
protected void registerJMX() {
// register with JMX
try {
jmxDataTreeBean = new DataTreeBean(getZKDatabase().getDataTree());
MBeanRegistry.getInstance().register(jmxDataTreeBean, jmxServerBean);
} catch (Exception e) {
LOG.warn("Failed to register with JMX", e);
jmxDataTreeBean = null;
}
}
代码示例来源:origin: apache/zookeeper
@Override
protected void registerJMX() {
// register with JMX
try {
jmxDataTreeBean = new DataTreeBean(getZKDatabase().getDataTree());
MBeanRegistry.getInstance().register(jmxDataTreeBean, jmxServerBean);
} catch (Exception e) {
LOG.warn("Failed to register with JMX", e);
jmxDataTreeBean = null;
}
}
代码示例来源:origin: apache/zookeeper
@Override
protected void registerJMX() {
// register with JMX
try {
jmxDataTreeBean = new DataTreeBean(getZKDatabase().getDataTree());
MBeanRegistry.getInstance().register(jmxDataTreeBean, jmxServerBean);
} catch (Exception e) {
LOG.warn("Failed to register with JMX", e);
jmxDataTreeBean = null;
}
}
代码示例来源:origin: apache/zookeeper
public void takeSnapshot(boolean syncSnap){
long start = Time.currentElapsedTime();
try {
txnLogFactory.save(zkDb.getDataTree(), zkDb.getSessionWithTimeOuts(), syncSnap);
} catch (IOException e) {
LOG.error("Severe unrecoverable error, exiting", e);
// This is a severe error that we cannot recover from,
// so we need to exit
System.exit(ExitCode.TXNLOG_ERROR_TAKING_SNAPSHOT.getValue());
}
long elapsed = Time.currentElapsedTime() - start;
LOG.info("Snapshot taken in " + elapsed + " ms");
ServerMetrics.SNAPSHOT_TIME.add(elapsed);
}
代码示例来源:origin: apache/zookeeper
@Override
public void commandRun() {
if (!isZKServerRunning()) {
pw.println(ZK_NOT_SERVING);
} else {
DataTree dt = zkServer.getZKDatabase().getDataTree();
if (len == FourLetterCommands.wchsCmd) {
dt.dumpWatchesSummary(pw);
} else if (len == FourLetterCommands.wchpCmd) {
dt.dumpWatches(pw, true);
} else {
dt.dumpWatches(pw, false);
}
pw.println();
}
}
}
代码示例来源:origin: apache/zookeeper
protected void registerJMX() {
// register with JMX
try {
jmxServerBean = new ZooKeeperServerBean(this);
MBeanRegistry.getInstance().register(jmxServerBean, null);
try {
jmxDataTreeBean = new DataTreeBean(zkDb.getDataTree());
MBeanRegistry.getInstance().register(jmxDataTreeBean, jmxServerBean);
} catch (Exception e) {
LOG.warn("Failed to register with JMX", e);
jmxDataTreeBean = null;
}
} catch (Exception e) {
LOG.warn("Failed to register with JMX", e);
jmxServerBean = null;
}
}
代码示例来源:origin: org.apache.zookeeper/zookeeper
@Override
protected void registerJMX() {
// register with JMX
try {
jmxDataTreeBean = new DataTreeBean(getZKDatabase().getDataTree());
MBeanRegistry.getInstance().register(jmxDataTreeBean, jmxServerBean);
} catch (Exception e) {
LOG.warn("Failed to register with JMX", e);
jmxDataTreeBean = null;
}
}
代码示例来源:origin: org.apache.zookeeper/zookeeper
@Override
protected void registerJMX() {
// register with JMX
try {
jmxDataTreeBean = new DataTreeBean(getZKDatabase().getDataTree());
MBeanRegistry.getInstance().register(jmxDataTreeBean, jmxServerBean);
} catch (Exception e) {
LOG.warn("Failed to register with JMX", e);
jmxDataTreeBean = null;
}
}
代码示例来源:origin: org.apache.zookeeper/zookeeper
@Override
protected void registerJMX() {
// register with JMX
try {
jmxDataTreeBean = new DataTreeBean(getZKDatabase().getDataTree());
MBeanRegistry.getInstance().register(jmxDataTreeBean, jmxServerBean);
} catch (Exception e) {
LOG.warn("Failed to register with JMX", e);
jmxDataTreeBean = null;
}
}
代码示例来源:origin: org.apache.zookeeper/zookeeper
/**
* deserialize a snapshot from an input archive
* @param ia the input archive you want to deserialize from
* @throws IOException
*/
public void deserializeSnapshot(InputArchive ia) throws IOException {
clear();
SerializeUtils.deserializeSnapshot(getDataTree(),ia,getSessionWithTimeOuts());
initialized = true;
}
代码示例来源:origin: apache/zookeeper
@Override
public CommandResponse run(ZooKeeperServer zkServer, Map<String, String> kwargs) {
DataTree dt = zkServer.getZKDatabase().getDataTree();
CommandResponse response = initializeResponse();
response.put("path_to_session_ids", dt.getWatchesByPath().toMap());
return response;
}
}
代码示例来源:origin: apache/zookeeper
@Override
public CommandResponse run(ZooKeeperServer zkServer, Map<String, String> kwargs) {
DataTree dt = zkServer.getZKDatabase().getDataTree();
CommandResponse response = initializeResponse();
response.putAll(dt.getWatchesSummary().toMap());
return response;
}
}
代码示例来源:origin: apache/zookeeper
@Override
public CommandResponse run(ZooKeeperServer zkServer, Map<String, String> kwargs) {
DataTree dt = zkServer.getZKDatabase().getDataTree();
CommandResponse response = initializeResponse();
response.put("session_id_to_watched_paths", dt.getWatches().toMap());
return response;
}
}
代码示例来源:origin: apache/zookeeper
private void addSerializeListener(int sid, String parent, String child) {
final ZooKeeper zkClient = zk[followerA];
CustomDataTree dt =
(CustomDataTree) mt[sid].main.quorumPeer.getZkDb().getDataTree();
dt.addListener(parent, new NodeSerializeListener() {
@Override
public void nodeSerialized(String path) {
try {
zkClient.delete(child, -1);
LOG.info("Deleted the child node after the parent is serialized");
} catch (Exception e) {
LOG.error("Error when deleting node {}", e);
}
}
});
}
代码示例来源:origin: apache/zookeeper
@Test(timeout = 30000)
public void testMultiWithContainerSimple()
throws KeeperException, InterruptedException {
Op createContainer = Op.create("/foo", new byte[0],
ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.CONTAINER);
zk.multi(Collections.singletonList(createContainer));
DataTree dataTree = serverFactory.getZooKeeperServer().getZKDatabase().getDataTree();
Assert.assertEquals(dataTree.getContainers().size(), 1);
}
代码示例来源:origin: apache/zookeeper
/**
* Checks if a session is registered with the server as a watcher.
*
* @param long sessionId the session ID to check
* @param path the path to check for watchers
* @param type the type of watcher
* @return true if the client session is a watcher on path for the type
*/
private boolean isServerSessionWatcher(long sessionId, String path,
WatcherType type) {
Set<ServerCnxn> cnxns = new HashSet<>();
CollectionUtils.addAll(cnxns, serverFactory.getConnections().iterator());
for (ServerCnxn cnxn : cnxns) {
if (cnxn.getSessionId() == sessionId) {
return getServer(serverFactory).getZKDatabase().getDataTree()
.containsWatcher(path, type, cnxn);
}
}
return false;
}
}
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.calculateTxnLogSizeLimit()方法的一些代码示例,展示了ZKDatabase.c
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.setDataTreeInit()方法的一些代码示例,展示了ZKDatabase.setDataTre
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.fastForwardDataBase()方法的一些代码示例,展示了ZKDatabase.fastFo
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.getLogLock()方法的一些代码示例,展示了ZKDatabase.getLogLock()的具体
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.getACL()方法的一些代码示例,展示了ZKDatabase.getACL()的具体用法。这些代码示
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.getminCommittedLog()方法的一些代码示例,展示了ZKDatabase.getminC
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.addCommittedProposal()方法的一些代码示例,展示了ZKDatabase.addCo
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.dumpEphemerals()方法的一些代码示例,展示了ZKDatabase.dumpEphemer
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.killSession()方法的一些代码示例,展示了ZKDatabase.killSession()的
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.clear()方法的一些代码示例,展示了ZKDatabase.clear()的具体用法。这些代码示例主
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.setWatches()方法的一些代码示例,展示了ZKDatabase.setWatches()的具体
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.removeCnxn()方法的一些代码示例,展示了ZKDatabase.removeCnxn()的具体
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.rollLog()方法的一些代码示例,展示了ZKDatabase.rollLog()的具体用法。这些代
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.isSpecialPath()方法的一些代码示例,展示了ZKDatabase.isSpecialPat
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.aclForNode()方法的一些代码示例,展示了ZKDatabase.aclForNode()的具体
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.getmaxCommittedLog()方法的一些代码示例,展示了ZKDatabase.getmaxC
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.deserializeSnapshot()方法的一些代码示例,展示了ZKDatabase.deseri
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.truncateLog()方法的一些代码示例,展示了ZKDatabase.truncateLog()的
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.setlastProcessedZxid()方法的一些代码示例,展示了ZKDatabase.setla
本文整理了Java中org.apache.zookeeper.server.ZKDatabase.commit()方法的一些代码示例,展示了ZKDatabase.commit()的具体用法。这些代码示
我是一名优秀的程序员,十分优秀!