/** Remove all redundant nodes **/ private void removeAllRedundantNodes() { try { checkRedundantNode("/" + parent); } catch (Exception e) { LOG.warn("Exception while removing all redundant nodes", e); } }
/** Remove all redundant nodes **/ private void removeAllRedundantNodes() { try { checkRedundantNode("/" + parent); } catch (Exception e) { LOG.warn("Exception while removing all redundant nodes", e); } }
private void checkRedundantNode(String node) { try { // Nothing to do if it is a lock mode if (getLockMode(node) != null) { return; } List<String> children = curatorFramework.getChildren().forPath(node); for (String child : children) { checkRedundantNode(node + "/" + child); } children = curatorFramework.getChildren().forPath(node); if ((children == null) || (children.isEmpty())) { curatorFramework.delete().forPath(node); } } catch (Exception e) { LOG.warn("Error in checkRedundantNode for node " + node, e); } }
private void checkRedundantNode(String node) { try { // Nothing to do if it is a lock mode if (getLockMode(node) != null) { return; } List<String> children = curatorFramework.getChildren().forPath(node); for (String child : children) { checkRedundantNode(node + "/" + child); } children = curatorFramework.getChildren().forPath(node); if ((children == null) || (children.isEmpty())) { curatorFramework.delete().forPath(node); } } catch (Exception e) { LOG.warn("Error in checkRedundantNode for node " + node, e); } }
/** Remove all redundant nodes **/ private void removeAllRedundantNodes() { try { checkRedundantNode("/" + parent); } catch (Exception e) { LOG.warn("Exception while removing all redundant nodes", e); } }
/** Remove all redundant nodes **/ private void removeAllRedundantNodes() { try { renewZookeeperInstance(sessionTimeout, quorumServers); checkRedundantNode("/" + parent); } catch (Exception e) { // ignore all errors } }
private void checkRedundantNode(String node) { try { // Nothing to do if it is a lock mode if (getLockMode(node) != null) { return; } List<String> children = curatorFramework.getChildren().forPath(node); for (String child : children) { checkRedundantNode(node + "/" + child); } children = curatorFramework.getChildren().forPath(node); if ((children == null) || (children.isEmpty())) { curatorFramework.delete().forPath(node); } } catch (Exception e) { LOG.warn("Error in checkRedundantNode for node " + node, e); } }
private void checkRedundantNode(String node) { try { // Nothing to do if it is a lock mode if (getLockMode(ctx.getConf(), node) != null) return; List<String> children = zooKeeper.getChildren(node, false); for (String child : children) { checkRedundantNode(node + "/" + child); } children = zooKeeper.getChildren(node, false); if ((children == null) || (children.isEmpty())) { zooKeeper.delete(node, -1); } } catch (Exception e) { // ignore all errors } }