public <T> T time(final String tag, final String name, ZooKeeperCallable<T> callable) throws KeeperException { final long startTime = clock.getTick(); try { return callable.call(); } catch (KeeperException e) { checkException(e, tag, name); throw e; } catch (Exception e) { Throwables.throwIfUnchecked(e); throw new RuntimeException(e); } finally { metrics.updateTimer(name, clock.getTick() - startTime, TimeUnit.NANOSECONDS); } }
@Override public void delete(String path, int version) throws KeeperException { try { client.delete(path, version); } catch (KeeperException e) { reporter.checkException(e, tag, "delete"); throw e; } }
@Override public byte[] getData(String path) throws KeeperException { try { return client.getData(path); } catch (KeeperException e) { reporter.checkException(e, tag, "getData"); throw e; } }
@Override public void deleteRecursive(String path) throws KeeperException { try { client.deleteRecursive(path); } catch (KeeperException e) { reporter.checkException(e, tag, "deleteRecursive"); throw e; } }
@Override public void create(String path) throws KeeperException { try { client.create(path); } catch (KeeperException e) { reporter.checkException(e, tag, "create"); throw e; } }
@Override public void ensurePath(String path) throws KeeperException { try { client.ensurePath(path); } catch (KeeperException e) { reporter.checkException(e, tag, "ensurePath"); throw e; } }
@Override public List<String> listRecursive(String path) throws KeeperException { try { return client.listRecursive(path); } catch (KeeperException e) { reporter.checkException(e, tag, "listRecursive"); throw e; } }
@Override public ZooKeeper.States getState() throws KeeperException { try { return client.getState(); } catch (KeeperException e) { reporter.checkException(e, tag, "getDeploymentGroupStatus"); throw e; } }
@Override public void delete(String path) throws KeeperException { try { client.delete(path); } catch (KeeperException e) { reporter.checkException(e, tag, "delete"); throw e; } }
@Override public void createAndSetData(String path, byte[] data) throws KeeperException { try { client.createAndSetData(path, data); } catch (KeeperException e) { reporter.checkException(e, tag, "createAndSetData"); throw e; } }
@Override public Stat stat(String path) throws KeeperException { try { return client.stat(path); } catch (KeeperException e) { reporter.checkException(e, tag, "stat"); throw e; } }
@Override public Collection<CuratorTransactionResult> transaction(List<ZooKeeperOperation> operations) throws KeeperException { try { return client.transaction(operations); } catch (KeeperException e) { reporter.checkException(e, tag, "transaction"); throw e; } }
@Override public void ensurePath(String path, boolean excludingLast) throws KeeperException { try { client.ensurePath(path, excludingLast); } catch (KeeperException e) { reporter.checkException(e, tag, "ensurePath"); throw e; } }
@Override public List<String> getChildren(String path) throws KeeperException { try { return client.getChildren(path); } catch (KeeperException e) { reporter.checkException(e, tag, "getChildren"); throw e; } }
@Override public void setData(String path, byte[] bytes) throws KeeperException { try { client.setData(path, bytes); } catch (KeeperException e) { reporter.checkException(e, tag, "setData"); throw e; } }
@Override public void createWithMode(String path, CreateMode mode) throws KeeperException { try { client.createWithMode(path, mode); } catch (KeeperException e) { reporter.checkException(e, tag, "createWithMode"); throw e; } }
@Override public Collection<CuratorTransactionResult> transaction(ZooKeeperOperation... operations) throws KeeperException { try { return client.transaction(operations); } catch (KeeperException e) { reporter.checkException(e, tag, "transaction"); throw e; } }
@Override public Node getNode(String path) throws KeeperException { try { return client.getNode(path); } catch (KeeperException e) { reporter.checkException(e, tag, "getNode"); throw e; } }
@Override public Stat exists(String path) throws KeeperException { try { return client.exists(path); } catch (KeeperException e) { reporter.checkException(e, tag, "exists"); throw e; } }