public boolean delete(String path) { try { return zkClient.delete(path); } catch (ZkNoNodeException ignored) { } return false; }
public boolean delete(String path) { try { return zkClient.delete(path); } catch (ZkNoNodeException ignored) { } return false; }
@Override public boolean delete(String path) { return zkClient.delete(path); } }
public void delete(String path) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); client.delete(path); }
public void delete(String path) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); client.delete(path); }
public static void deletePath(final ZkClient client, final String path) throws Exception { try { client.delete(path); } catch (final ZkNoNodeException e) { logger.info(path + " deleted during connection loss; this is ok"); } catch (final Exception e) { throw e; } }
private void removeNode(URL url, ZkNodeType nodeType) { String nodePath = ZkUtils.toNodePath(url, nodeType); if (zkClient.exists(nodePath)) { zkClient.delete(nodePath); } }
private void addAndRemoveNewInstanceConfig(ZkClient zkClient) throws Exception { int biggerRandomNumber = NUM_INSTANCES + new Random().nextInt(NUM_INSTANCES); String instanceName = "Server_localhost_" + String.valueOf(biggerRandomNumber); String instanceConfigPath = PropertyPathBuilder.instanceConfig(_helixClusterName, instanceName); Assert.assertFalse(zkClient.exists(instanceConfigPath)); List<String> instances = _helixResourceManager.getAllInstances(); Assert.assertFalse(instances.contains(instanceName)); // Add new ZNode. ZNRecord znRecord = new ZNRecord(instanceName); zkClient.createPersistent(instanceConfigPath, znRecord); List<String> latestAllInstances = _helixResourceManager.getAllInstances(); long maxTime = System.currentTimeMillis() + MAX_TIMEOUT_IN_MILLISECOND; while (!latestAllInstances.contains(instanceName) && System.currentTimeMillis() < maxTime) { Thread.sleep(100L); latestAllInstances = _helixResourceManager.getAllInstances(); } Assert.assertTrue(System.currentTimeMillis() < maxTime, "Timeout when waiting for adding instance config"); // Remove new ZNode. zkClient.delete(instanceConfigPath); latestAllInstances = _helixResourceManager.getAllInstances(); maxTime = System.currentTimeMillis() + MAX_TIMEOUT_IN_MILLISECOND; while (latestAllInstances.contains(instanceName) && System.currentTimeMillis() < maxTime) { Thread.sleep(100L); latestAllInstances = _helixResourceManager.getAllInstances(); } Assert.assertTrue(System.currentTimeMillis() < maxTime, "Timeout when waiting for removing instance config"); }
public void delete(String path) { Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!")); client.delete(path); }
/** * delete plugins. * * @param ids primary key. * @return rows */ @Override @Transactional(rollbackFor = Exception.class) public int delete(final List<String> ids) { int pluginCount = 0; for (String id : ids) { PluginDO pluginDO = pluginMapper.selectById(id); pluginCount += pluginMapper.delete(id); String pluginPath = ZkPathConstants.buildPluginPath(pluginDO.getName()); if (zkClient.exists(pluginPath)) { zkClient.delete(pluginPath); } String selectorParentPath = ZkPathConstants.buildSelectorParentPath(pluginDO.getName()); if (zkClient.exists(selectorParentPath)) { zkClient.delete(selectorParentPath); } String ruleParentPath = ZkPathConstants.buildRuleParentPath(pluginDO.getName()); if (zkClient.exists(ruleParentPath)) { zkClient.delete(ruleParentPath); } } return pluginCount; }
/** * delete application authorities. * * @param ids primary key. * @return rows */ @Override public int delete(final List<String> ids) { int appAuthCount = 0; for (String id : ids) { AppAuthDO appAuthDO = appAuthMapper.selectById(id); appAuthCount += appAuthMapper.delete(id); String pluginPath = ZkPathConstants.buildAppAuthPath(appAuthDO.getAppKey()); if (zkClient.exists(pluginPath)) { zkClient.delete(pluginPath); } } return appAuthCount; }
/** * delete rules. * * @param ids primary key. * @return rows */ @Override @Transactional(rollbackFor = Exception.class) public int delete(final List<String> ids) { for (String id : ids) { RuleDO ruleDO = ruleMapper.selectById(id); SelectorDO selectorDO = selectorMapper.selectById(ruleDO.getSelectorId()); PluginDO pluginDO = pluginMapper.selectById(selectorDO.getPluginId()); ruleMapper.delete(id); ruleConditionMapper.deleteByQuery(new RuleConditionQuery(id)); String ruleRealPath = ZkPathConstants.buildRulePath(pluginDO.getName(), selectorDO.getId(), ruleDO.getId()); if (zkClient.exists(ruleRealPath)) { zkClient.delete(ruleRealPath); } } return ids.size(); }
public void delete(String path) { try { client.delete(path); } catch (ZkNoNodeException e) { } }
public void delete(String path) { try { client.delete(path); } catch (ZkNoNodeException e) { } }
}); ruleZKs.forEach(ruleZK -> zkClient.delete(ZkPathConstants.buildRulePath(pluginDO.getName(), selectorDO.getId(), ruleZK))); }); zkClient.delete(ZkPathConstants.buildSelectorRealPath(pluginDO.getName(), selectorZK)); String ruleParentPath = ZkPathConstants.buildRuleParentPath(pluginDO.getName()); zkClient.getChildren(ruleParentPath).forEach(selectorRulePath -> { if (selectorRulePath.split(ZkPathConstants.SELECTOR_JOIN_RULE)[0].equals(selectorZK)) { zkClient.delete(ruleParentPath + "/" + selectorRulePath);
/** * {@inheritDoc} */ @Override public void delete(String key) { zkClient.delete(getZkPathForKey(key)); }
/** * {@inheritDoc} */ @Override public void delete(byte[] key) { zkClient.delete(getZkPathForKey(key)); }
@Override public synchronized void unregister(String jobName) { JobConfig config = schedulerConfgs.get(jobName); String path = getPath(config); if(zkClient.getChildren(nodeStateParentPath).size() == 1){ zkClient.delete(path); logger.info("all node is closed ,delete path:"+path); } }