gpt4 book ai didi

org.apache.ignite.spi.discovery.zk.internal.ZookeeperClient.getChildrenAsync()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 09:49:39 25 4
gpt4 key购买 nike

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

ZookeeperClient.getChildrenAsync介绍

暂无

代码示例

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

/** {@inheritDoc} */
  @Override public void execute() {
    getChildrenAsync(path, watcher, cb);
  }
}

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

/** {@inheritDoc} */
@Override protected void process0(WatchedEvent evt) {
  if (evt.getType() == Watcher.Event.EventType.NodeChildrenChanged)
    rtState.zkClient.getChildrenAsync(evt.getPath(), this, this);
}

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

/** {@inheritDoc} */
  @Override void onPreviousNodeFail() {
    if (log.isInfoEnabled())
      log.info("Previous server node failed, check is node new coordinator [locId=" + locNode.id() + ']');
    rtState.zkClient.getChildrenAsync(zkPaths.aliveNodesDir, null, new CheckCoordinatorCallback(rtState));
  }
}

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

/** {@inheritDoc} */
  @Override void onPreviousNodeFail() {
    if (log.isInfoEnabled())
      log.info("Watched node failed, check if there are alive servers [locId=" + locNode.id() + ']');
    rtState.zkClient.getChildrenAsync(zkPaths.aliveNodesDir, null, new CheckClientsStatusCallback(rtState));
  }
}

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

/** {@inheritDoc} */
@Override public void process0(WatchedEvent evt) {
  if (evt.getType() == Event.EventType.NodeDataChanged) {
    if (evt.getPath().equals(zkPaths.evtsPath)) {
      if (!rtState.crd)
        rtState.zkClient.getDataAsync(evt.getPath(), this, this);
    }
    else
      U.warn(log, "Received NodeDataChanged for unexpected path: " + evt.getPath());
  }
  else if (evt.getType() == Event.EventType.NodeChildrenChanged) {
    if (evt.getPath().equals(zkPaths.aliveNodesDir))
      rtState.zkClient.getChildrenAsync(evt.getPath(), this, this);
    else if (evt.getPath().equals(zkPaths.customEvtsDir))
      rtState.zkClient.getChildrenAsync(evt.getPath(), this, this);
    else
      U.warn(log, "Received NodeChildrenChanged for unexpected path: " + evt.getPath());
  }
}

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

rtState.zkClient.getChildrenAsync(zkPaths.aliveNodesDir, rtState.watcher, rtState.watcher);
rtState.zkClient.getChildrenAsync(zkPaths.aliveNodesDir, rtState.watcher, rtState.watcher);

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

rtState.zkClient.getChildrenAsync(futPath, watcher, watcher);

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

rtState.zkClient.getChildrenAsync(zkPaths.aliveNodesDir, rtState.watcher, rtState.watcher);

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

log.debug("Failed to save no servers message. Path version changed.");
rtState.zkClient.getChildrenAsync(zkPaths.aliveNodesDir, null,
  new CheckClientsStatusCallback(rtState));

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

client.getChildrenAsync("/apacheIgnite1", null, new AsyncCallback.Children2Callback() {
  @Override public void processResult(int rc, String path, Object ctx, List<String> children, Stat stat) {
    try {

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

/**
 * @throws Exception If failed.
 */
@Test
public void testReconnect1_Callback() throws Exception {
  startZK(1);
  ZookeeperClient client = createClient(SES_TIMEOUT);
  client.createIfNeeded("/apacheIgnite1", null, CreateMode.PERSISTENT);
  zkCluster.getServers().get(0).stop();
  final CountDownLatch l = new CountDownLatch(1);
  client.getChildrenAsync("/apacheIgnite1", null, new AsyncCallback.Children2Callback() {
    @Override public void processResult(int rc, String path, Object ctx, List<String> children, Stat stat) {
      info("Callback: " + rc);
      if (rc == 0)
        l.countDown();
    }
  });
  IgniteInternalFuture fut = GridTestUtils.runAsync(new Callable<Void>() {
    @Override public Void call() throws Exception {
      U.sleep(2000);
      info("Restart zookeeper server");
      zkCluster.getServers().get(0).restart();
      info("Zookeeper server restarted");
      return null;
    }
  }, "start-zk");
  assertTrue(l.await(10, TimeUnit.SECONDS));
  fut.get();
}

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

rtState.zkClient.getChildrenAsync(zkPaths.aliveNodesDir, rtState.watcher, rtState.watcher);
rtState.zkClient.getChildrenAsync(zkPaths.customEvtsDir, rtState.watcher, rtState.watcher);

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

/**
 * @throws Exception If failed.
 */
@Test
public void testConnectionLoss4() throws Exception {
  startZK(1);
  CallbackFuture cb = new CallbackFuture();
  final ZookeeperClient client = new ZookeeperClient(log, zkCluster.getConnectString(), 3000, cb);
  client.createIfNeeded("/apacheIgnite1", null, CreateMode.PERSISTENT);
  final CountDownLatch l = new CountDownLatch(1);
  client.getChildrenAsync("/apacheIgnite1", null, new AsyncCallback.Children2Callback() {
    @Override public void processResult(int rc, String path, Object ctx, List<String> children, Stat stat) {
      closeZK();
      try {
        client.createIfNeeded("/apacheIgnite2", null, CreateMode.PERSISTENT);
      }
      catch (ZookeeperClientFailedException e) {
        info("Expected error: " + e);
        l.countDown();
      }
      catch (Exception e) {
        fail("Unexpected error: " + e);
      }
    }
  });
  assertTrue(l.await(10, TimeUnit.SECONDS));
  cb.get();
}

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

zkClient.getChildrenAsync(zkPaths.aliveNodesDir, null, new CheckCoordinatorCallback(rtState));

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

rtState.zkClient.getChildrenAsync(zkPaths.aliveNodesDir, rtState.watcher, rtState.watcher);

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

rtState.zkClient.getChildrenAsync(zkPaths.aliveNodesDir, null, new CheckClientsStatusCallback(rtState));

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