gpt4 book ai didi

com.ngdata.sep.util.zookeeper.ZooKeeperItf.addDefaultWatcher()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 18:41:31 26 4
gpt4 key购买 nike

本文整理了Java中com.ngdata.sep.util.zookeeper.ZooKeeperItf.addDefaultWatcher()方法的一些代码示例,展示了ZooKeeperItf.addDefaultWatcher()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperItf.addDefaultWatcher()方法的具体详情如下:
包路径:com.ngdata.sep.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: com.ngdata/hbase-indexer-common

/**
 *
 * @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/hbase-indexer

/**
 *
 * @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/hbase-indexer

public IndexerModelImpl(ZooKeeperItf zk, String zkRoot) throws InterruptedException, KeeperException {
  this.zk = zk;
  this.indexerCollectionPath = zkRoot + "/indexer";
  this.indexerCollectionPathSlash = indexerCollectionPath + "/";
  this.indexerTrashPath = zkRoot + "/indexer-trash";
  ZkUtil.createPath(zk, indexerCollectionPath);
  ZkUtil.createPath(zk, indexerTrashPath);
  zk.addDefaultWatcher(connectStateWatcher);
  indexerCacheRefresher.start();
  indexerCacheRefresher.waitUntilStarted();
}

代码示例来源:origin: com.ngdata/hbase-indexer-model

public IndexerModelImpl(ZooKeeperItf zk, String zkRoot) throws InterruptedException, KeeperException {
  this.zk = zk;
  this.indexerCollectionPath = zkRoot + "/indexer";
  this.indexerCollectionPathSlash = indexerCollectionPath + "/";
  this.indexerTrashPath = zkRoot + "/indexer-trash";
  ZkUtil.createPath(zk, indexerCollectionPath);
  ZkUtil.createPath(zk, indexerTrashPath);
  zk.addDefaultWatcher(connectStateWatcher);
  indexerCacheRefresher.start();
  indexerCacheRefresher.waitUntilStarted();
}

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