public byte[] getData(CuratorFramework zk, String path, boolean watch) throws Exception { String normPath = PathUtils.normalize_path(path); try { if (existsNode(zk, normPath, watch)) { if (watch) { return zk.getData().watched().forPath(normPath); } else { return zk.getData().forPath(normPath); } } } catch (KeeperException e) { LOG.error("zookeeper getdata for path" + path, e); } return null; }
@Override public byte[] readData(String path, Stat stat, boolean watch) throws KeeperException, InterruptedException { try { if ( stat != null ) { return watch ? curator.getData().storingStatIn(stat).watched().forPath(path) : curator.getData().storingStatIn(stat).forPath(path); } else { return watch ? curator.getData().watched().forPath(path) : curator.getData().forPath(path); } } catch ( Exception e ) { adjustException(e); } return null; // will never execute }
data = new HiveLockObjectData(new String(curatorFramework.getData().watched().forPath(curChild))); data.setClientIp(clientIp); } catch (Exception e) {
data = new HiveLockObjectData(new String(curatorFramework.getData().watched().forPath(curChild))); data.setClientIp(clientIp); } catch (Exception e) {
@Override public BackgroundPathable<byte[]> watched() { return new BackgroundPathableDecorator<>(inner.watched()); }
public byte[] getData(CuratorFramework zk, String path , boolean watch) throws Exception { String npath = PathUtils.normalize_path(path); try { if (existsNode(zk,path,watch)) { if (watch) { return zk.getData().watched().forPath(npath); } else { return zk.getData().forPath(npath); } } } catch (KeeperException e) { LOG.error("zookeeper getdata for path:" + path ,e); } return null; }
private Tuple<String, String> loadKey(final String nodePath) throws Exception { final String nodeName = ZKPaths.getNodeFromPath(nodePath); final Set<String> keysSpecified = configProfile.getKeysSpecified(); switch (configProfile.getKeyLoadingMode()) { case INCLUDE: if (keysSpecified == null || !keysSpecified.contains(nodeName)) { return null; } break; case EXCLUDE: if (keysSpecified.contains(nodeName)) { return null; } break; case ALL: break; default: break; } final GetDataBuilder data = client.getData(); final String value = new String(data.watched().forPath(nodePath), "UTF-8"); return new Tuple<>(nodeName, value); }
private Tuple<String, String> loadKey(final String nodePath) throws Exception { final String nodeName = ZKPaths.getNodeFromPath(nodePath); final Set<String> keysSpecified = configProfile.getKeysSpecified(); switch (configProfile.getKeyLoadingMode()) { case INCLUDE: if (keysSpecified == null || !keysSpecified.contains(nodeName)) { return null; } break; case EXCLUDE: if (keysSpecified.contains(nodeName)) { return null; } break; case ALL: break; default: break; } final GetDataBuilder data = client.getData(); final String value = new String(data.watched().forPath(nodePath), "UTF-8"); return new Tuple<>(nodeName, value); }
data = new HiveLockObjectData(new String(curatorFramework.getData().watched().forPath(curChild))); data.setClientIp(clientIp); } catch (Exception e) {