gpt4 book ai didi

org.lilyproject.util.zookeeper.ZooKeeperItf.addDefaultWatcher()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 20:12:49 26 4
gpt4 key购买 nike

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

ZooKeeperItf.addDefaultWatcher介绍

[英]Adds an additional watcher to be called as default watcher. This should mainly be used for reacting to connection-related events.

This is a Lily-specific method.
[中]添加一个额外的观察程序,称为默认观察程序。这主要用于对连接相关事件做出反应。
这是一种百合特有的方法。

代码示例

代码示例来源:origin: NGDATA/lilyproject

@Override
public void addDefaultWatcher(Watcher watcher) {
  wrapped.addDefaultWatcher(watcher);
}

代码示例来源:origin: NGDATA/lilyproject

/**
 *
 * @param position a name for what position this leader election is about, used in informational messages.
 * @param electionPath path under which the ephemeral leader election nodes should be created. The path
 *                     will be created if it does not exist. The path should not end on a slash.
 */
public LeaderElection(ZooKeeperItf zk, String position, String electionPath, LeaderElectionCallback callback)
    throws LeaderElectionSetupException, InterruptedException, KeeperException {
  this.zk = zk;
  this.position = position;
  this.electionPath = electionPath;
  this.callback = callback;
  proposeAsLeader();
  zk.addDefaultWatcher(connectStateWatcher);
  leaderProvisioner.start();
}

代码示例来源:origin: NGDATA/lilyproject

ZkUtil.createPath(zooKeeper, CACHE_REFRESHENABLED_PATH);
connectionWatcher = new ConnectionWatcher();
zooKeeper.addDefaultWatcher(connectionWatcher);
readRefreshingEnabledState();
refreshAll();

代码示例来源:origin: NGDATA/lilyproject

public void init() throws KeeperException, InterruptedException {
  ZkUtil.createPath(zk, REPOSITORY_COLLECTION_PATH);
  assureDefaultRepositoryExists();
  zkWatcher = new RepositoryZkWatcher();
  zk.addDefaultWatcher(zkWatcher);
  refresh();
}

代码示例来源:origin: NGDATA/lilyproject

private void init() throws InterruptedException, KeeperException, NoServersException, RepositoryException {
  this.isClosed = false; // needs to be before refreshServers and schemaCache.start()
  zk.addDefaultWatcher(watcher);
  refreshServers();
  repositoryModel = new RepositoryModelImpl(zk);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com