gpt4 book ai didi

org.I0Itec.zkclient.ZkClient.delete()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 12:52:40 25 4
gpt4 key购买 nike

本文整理了Java中org.I0Itec.zkclient.ZkClient.delete()方法的一些代码示例,展示了ZkClient.delete()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkClient.delete()方法的具体详情如下:
包路径:org.I0Itec.zkclient.ZkClient
类名称:ZkClient
方法名:delete

ZkClient.delete介绍

暂无

代码示例

代码示例来源:origin: ltsopensource/light-task-scheduler

public boolean delete(String path) {
  try {
    return zkClient.delete(path);
  } catch (ZkNoNodeException ignored) {
  }
  return false;
}

代码示例来源:origin: ltsopensource/light-task-scheduler

public boolean delete(String path) {
  try {
    return zkClient.delete(path);
  } catch (ZkNoNodeException ignored) {
  }
  return false;
}

代码示例来源:origin: networknt/light-4j

@Override
  public boolean delete(String path) {
    return zkClient.delete(path);
  }
}

代码示例来源:origin: apache/incubator-dubbo

public void delete(String path) {
  Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
  client.delete(path);
}

代码示例来源:origin: apache/incubator-dubbo

public void delete(String path) {
  Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
  client.delete(path);
}

代码示例来源:origin: killme2008/Metamorphosis

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;
  }
}

代码示例来源:origin: weibocom/motan

private void removeNode(URL url, ZkNodeType nodeType) {
  String nodePath = ZkUtils.toNodePath(url, nodeType);
  if (zkClient.exists(nodePath)) {
    zkClient.delete(nodePath);
  }
}

代码示例来源:origin: apache/incubator-pinot

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");
}

代码示例来源:origin: javahongxi/whatsmars

public void delete(String path) {
  Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
  client.delete(path);
}

代码示例来源:origin: Dromara/soul

zkClient.delete(ZkPathConstants.buildPluginPath(pluginZK));
String selectorParentPath = ZkPathConstants.buildSelectorParentPath(pluginZK);
if (zkClient.exists(selectorParentPath)) {
  zkClient.delete(selectorParentPath);
  zkClient.delete(ruleParentPath);

代码示例来源:origin: Dromara/soul

/**
 * 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;
}

代码示例来源:origin: Dromara/soul

/**
 * 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;
}

代码示例来源:origin: Dromara/soul

/**
 * 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();
}

代码示例来源:origin: jobxhub/JobX

public void delete(String path) {
  try {
    client.delete(path);
  } catch (ZkNoNodeException e) {
  }
}

代码示例来源:origin: hutai123/dubbox

public void delete(String path) {
  try {
    client.delete(path);
  } catch (ZkNoNodeException e) {
  }
}

代码示例来源:origin: Dromara/soul

zkClient.delete(selectorRealPath);
    zkClient.delete(rulePath);

代码示例来源:origin: Dromara/soul

});
  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);

代码示例来源:origin: apache/samza

/**
 * {@inheritDoc}
 */
@Override
public void delete(String key) {
 zkClient.delete(getZkPathForKey(key));
}

代码示例来源:origin: org.apache.samza/samza-core_2.12

/**
 * {@inheritDoc}
 */
@Override
public void delete(byte[] key) {
 zkClient.delete(getZkPathForKey(key));
}

代码示例来源:origin: vakinge/jeesuite-libs

@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);
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com