@Test public void testReconnect2() throws Exception { startZK(1); ZookeeperClient client = createClient(SES_TIMEOUT); client.createIfNeeded("/apacheIgnite1", null, CreateMode.PERSISTENT); zkCluster.getServers().get(0).restart(); client.createIfNeeded("/apacheIgnite2", null, CreateMode.PERSISTENT); }
String createIfNeeded(String path, byte[] data, CreateMode createMode) throws ZookeeperClientFailedException, InterruptedException { assert !createMode.isSequential() : createMode; if (data == null) data = EMPTY_BYTES; for (;;) { long connStartTime = this.connStartTime; try { return zk.create(path, data, ZK_ACL, createMode); } catch (KeeperException.NodeExistsException e) { if (log.isDebugEnabled()) log.debug("Node already exists: " + path); return path; } catch (Exception e) { onZookeeperError(connStartTime, e); } } }
ZookeeperClient implements Watcher { String createIfNeeded(String path, byte[] data, CreateMode createMode) throws ZookeeperClientFailedException, InterruptedException { assert !createMode.isSequential() : createMode; if (data == null) data = EMPTY_BYTES; for (;;) { long connStartTime = this.connStartTime; try { return zk.create(path, data, ZK_ACL, createMode); } catch (KeeperException.NodeExistsException e) { if (log.isDebugEnabled()) log.debug("Node already exists: " + path); return path; } catch (Exception e) { onZookeeperError(connStartTime, e); } } } }
ZookeeperClient implements Watcher { String createIfNeeded(String path, byte[] data, CreateMode createMode) throws ZookeeperClientFailedException, InterruptedException { assert !createMode.isSequential() : createMode; if (data == null) data = EMPTY_BYTES; for (;;) { long connStartTime = this.connStartTime; try { return zk.create(path, data, ZK_ACL, createMode); } catch (KeeperException.NodeExistsException e) { if (log.isDebugEnabled()) log.debug("Node already exists: " + path); return path; } catch (Exception e) { onZookeeperError(connStartTime, e); } } } ZookeeperClient(IgniteLogger log, String connectString, int sesTimeout, IgniteRunnable connLostC);   ZookeeperClient(String igniteInstanceName,
        IgniteLogger log,
        String connectString,
        int sesTimeout,
        IgniteRunnable connLostC); }
ZookeeperClient implements Watcher { String createIfNeeded(String path, byte[] data, CreateMode createMode) throws ZookeeperClientFailedException, InterruptedException { assert !createMode.isSequential() : createMode; if (data == null) data = EMPTY_BYTES; for (;;) { long connStartTime = this.connStartTime; try { return zk.create(path, data, ZK_ACL, createMode); } catch (KeeperException.NodeExistsException e) { if (log.isDebugEnabled()) log.debug("Node already exists: " + path); return path; } catch (Exception e) { onZookeeperError(connStartTime, e); } } } ZookeeperClient(IgniteLogger log, String connectString, int sesTimeout, IgniteRunnable connLostC);   ZookeeperClient(String igniteInstanceName,
        IgniteLogger log,
        String connectString,
        int sesTimeout,
        IgniteRunnable connLostC); @Override void process(WatchedEvent evt); void close(); }
ZookeeperClient implements Watcher { String createIfNeeded(String path, byte[] data, CreateMode createMode) throws ZookeeperClientFailedException, InterruptedException { assert !createMode.isSequential() : createMode; if (data == null) data = EMPTY_BYTES; for (;;) { long connStartTime = this.connStartTime; try { return zk.create(path, data, ZK_ACL, createMode); } catch (KeeperException.NodeExistsException e) { if (log.isDebugEnabled()) log.debug("Node already exists: " + path); return path; } catch (Exception e) { onZookeeperError(connStartTime, e); } } } ZookeeperClient(IgniteLogger log, String connectString, int sesTimeout, IgniteRunnable connLostC);   ZookeeperClient(String igniteInstanceName,
        IgniteLogger log,
        String connectString,
        int sesTimeout,
        IgniteRunnable connLostC); @Override void process(WatchedEvent evt); void close();  }