Examples of IZkStateListener


Examples of org.I0Itec.zkclient.IZkStateListener

   * @throws Exception
   */
  public static void expireSession(final ZkClient zkClient) throws Exception {
    final CountDownLatch waitNewSession = new CountDownLatch(1);

    IZkStateListener listener = new IZkStateListener() {
      @Override
      public void handleStateChanged(KeeperState state) throws Exception {
        LOG.info("IZkStateListener#handleStateChanged, state: " + state);
      }

View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

                address.append(",");
                address.append(appendDefaultPort(backup));
            }
        }
        zkClient = new ZkClient(address.toString());
        zkClient.subscribeStateChanges(new IZkStateListener() {
            public void handleStateChanged(KeeperState state) throws Exception {
                ZookeeperRegistry.this.zkState = state;
            }
            public void handleNewSession() throws Exception {
            }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

                        try {
                            if (zkclientx != null) {
                                final String path = ZookeeperPathUtils.getDestinationClusterNode(destination, ip + ":"
                                                                                                              + port);
                                initCid(path);
                                zkclientx.subscribeStateChanges(new IZkStateListener() {

                                    public void handleStateChanged(KeeperState state) throws Exception {

                                    }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

        logger.info("## start the canal server[{}:{}]", ip, port);
        // 创建整个canal的工作节点
        final String path = ZookeeperPathUtils.getCanalClusterNode(ip + ":" + port);
        initCid(path);
        if (zkclientx != null) {
            this.zkclientx.subscribeStateChanges(new IZkStateListener() {

                public void handleStateChanged(KeeperState state) throws Exception {

                }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

                        try {
                            if (zkclientx != null) {
                                final String path = ZookeeperPathUtils.getDestinationClusterNode(destination, ip + ":"
                                                                                                              + port);
                                initCid(path);
                                zkclientx.subscribeStateChanges(new IZkStateListener() {

                                    public void handleStateChanged(KeeperState state) throws Exception {

                                    }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

        logger.info("## start the canal server[{}:{}]", ip, port);
        // 创建整个canal的工作节点
        final String path = ZookeeperPathUtils.getCanalClusterNode(ip + ":" + port);
        initCid(path);
        if (zkclientx != null) {
            this.zkclientx.subscribeStateChanges(new IZkStateListener() {

                public void handleStateChanged(KeeperState state) throws Exception {

                }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

    oldZookeeper = zkConnection.getZookeeper();
    LOG.info("After session expiry sessionId = " + oldZookeeper.getSessionId());
  }

  protected void simulateSessionExpiry(ZkClient zkClient) throws IOException, InterruptedException {
    IZkStateListener listener = new IZkStateListener() {
      @Override
      public void handleStateChanged(KeeperState state) throws Exception {
        LOG.info("In Old connection, state changed:" + state);
      }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

    AssertJUnit.assertNotSame(stat, newStat);
  }

  @Test()
  void testSessioExpire() throws Exception {
    IZkStateListener listener = new IZkStateListener() {

      @Override
      public void handleStateChanged(KeeperState state) throws Exception {
        System.out.println("In Old connection New state " + state);
      }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

  static {
    // Logger.getRootLogger().setLevel(Level.DEBUG);
  }

  public static void disconnectSession(final ZkClient zkClient) throws Exception {
    IZkStateListener listener = new IZkStateListener() {
      @Override
      public void handleStateChanged(KeeperState state) throws Exception {
        // System.err.println("disconnectSession handleStateChanged. state: " + state);
      }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

   * @throws Exception
   */
  public static void expireSession(final ZkClient zkClient) throws Exception {
    final CountDownLatch waitNewSession = new CountDownLatch(1);

    IZkStateListener listener = new IZkStateListener() {
      @Override
      public void handleStateChanged(KeeperState state) throws Exception {
        LOG.info("IZkStateListener#handleStateChanged, state: " + state);
      }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.