@Override public void close() { this.zkClient.close(); } }
protected ZkClient createInnerZkClient(String zkServers, int sessionTimeout, int connectionTimeout) { return new ZkClient(zkServers, sessionTimeout, connectionTimeout); } }
public void addListener(IZkStateListener listener) { completableFuture.whenComplete((value, exception) -> { this.makeClientReady(value, exception); if (exception == null) { client.subscribeStateChanges(listener); } }); }
public void createPersistent(String path, String data) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); client.createPersistent(path, data); }
public boolean exists(String path) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); return client.exists(path); }
public String getData(String path) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); return client.readData(path); }
public List<String> getChildren(String path) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); return client.getChildren(path); }
public void delete(String path) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); client.delete(path); }
public List<String> subscribeChildChanges(String path, final IZkChildListener listener) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); return client.subscribeChildChanges(path, listener); }
public void createEphemeral(String path, String data) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); client.createEphemeral(path, data); }
public void unsubscribeChildChanges(String path, IZkChildListener listener) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); client.unsubscribeChildChanges(path, listener); }
public ZkClientWrapper(final String serverAddr, long timeout) { this.timeout = timeout; completableFuture = CompletableFuture.supplyAsync(() -> new ZkClient(serverAddr, Integer.MAX_VALUE)); }
public void createPersistent(String path) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); client.createPersistent(path, true); }
public boolean exists(String path) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); return client.exists(path); }
public String getData(String path) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); return client.readData(path); }
public void createEphemeral(String path) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); client.createEphemeral(path); }
public void addListener(IZkStateListener listener) { completableFuture.whenComplete((value, exception) -> { this.makeClientReady(value, exception); if (exception == null) { client.subscribeStateChanges(listener); } }); }
public ZkClientWrapper(final String serverAddr, long timeout) { this.timeout = timeout; completableFuture = CompletableFuture.supplyAsync(() -> new ZkClient(serverAddr, Integer.MAX_VALUE)); }
public void createPersistent(String path, String data) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); client.createPersistent(path, data); }
public void createEphemeral(String path) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); client.createEphemeral(path); }