org.apache.zookeeper.ZooKeeper.getExistWatches()方法的使用及代码示例

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

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

ZooKeeper.getExistWatches介绍

暂无

代码示例

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

List<String> existWatches = zooKeeper.getExistWatches();
List<String> childWatches = zooKeeper.getChildWatches();
if (!dataWatches.isEmpty()

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

/**
 * Test verifies many pre-node watchers. Also, verifies internal
 * datastructure 'watchManager.existWatches'
 */
@Test(timeout = 90000)
public void testManyPreNodeWatchers() throws Exception {
  int count = 50;
  List<MyWatcher> wList = new ArrayList<MyWatcher>(count);
  MyWatcher w;
  String path = "/node";
  // Exists watcher
  for (int i = 0; i < count; i++) {
    final String nodePath = path + i;
    w = new MyWatcher(nodePath, 1);
    wList.add(w);
    LOG.info("Adding pre node watcher {} on path {}", new Object[] { w,
        nodePath });
    zk1.exists(nodePath, w);
  }
  Assert.assertEquals("Failed to add watchers!", count, zk1
      .getExistWatches().size());
  for (int i = 0; i < count; i++) {
    final MyWatcher watcher = wList.get(i);
    removeWatches(zk1, path + i, watcher, WatcherType.Data, false,
        Code.OK);
    Assert.assertTrue("Didn't remove data watcher", watcher.matches());
  }
  Assert.assertEquals("Didn't remove watch references!", 0, zk1
      .getExistWatches().size());
}

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

List<String> existWatches = zooKeeper.getExistWatches();
List<String> childWatches = zooKeeper.getChildWatches();
if (!dataWatches.isEmpty()

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

myWatcher1.matches();
Assert.assertEquals(
    "Failed to remove pre-create watches :" + zk.getExistWatches(),
    1, zk.getExistWatches().size());
Assert.assertTrue(
    "Failed to remove pre-create watches :" + zk.getExistWatches(),
    zk.getExistWatches().contains("/testnode1/testnode2"));
    "Failed to remove pre-create watches : " + zk.getExistWatches(),
    0, zk.getExistWatches().size());

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

|| !zooKeeper.getExistWatches().isEmpty()
   || !zooKeeper.getChildWatches().isEmpty()))
    zooKeeper.getExistWatches(),
    zooKeeper.getChildWatches());
RequestHeader h = new RequestHeader();

相关文章