org.apache.helix.manager.zk.ZKUtil.subtract()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(125)

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

ZKUtil.subtract介绍

暂无

代码示例

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

  1. /**
  2. * Selectively removes fields appearing in the given IdealState (input) from the IdealState in ZK.
  3. * @param clusterName
  4. * @param resourceName
  5. * @param idealState
  6. */
  7. @Override
  8. public void removeFromIdealState(String clusterName, String resourceName, IdealState idealState) {
  9. String zkPath = PropertyPathBuilder.idealState(clusterName, resourceName);
  10. ZKUtil.subtract(_zkClient, zkPath, idealState.getRecord());
  11. }

代码示例来源:origin: org.apache.helix/helix-core

  1. ZKUtil.subtract(zkClient, splits[0], update);

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

  1. ZKUtil.subtract(zkClient, splits[0], update);

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

  1. /**
  2. * Remove multiple configs
  3. *
  4. * @param scope scope specification of the entity set to query (e.g. cluster, resource,
  5. * participant, etc.)
  6. * @param recordToRemove the ZNRecord that holds the entries that needs to be removed
  7. */
  8. public void remove(HelixConfigScope scope, ZNRecord recordToRemove) {
  9. if (scope == null || scope.getType() == null || !scope.isFullKey()) {
  10. LOG.error("fail to remove. invalid scope: " + scope);
  11. return;
  12. }
  13. String clusterName = scope.getClusterName();
  14. if (!ZKUtil.isClusterSetup(clusterName, zkClient)) {
  15. throw new HelixException("fail to remove. cluster " + clusterName + " is not setup yet");
  16. }
  17. String zkPath = scope.getZkPath();
  18. ZKUtil.subtract(zkClient, zkPath, recordToRemove);
  19. }

代码示例来源:origin: org.apache.helix/helix-core

  1. /**
  2. * Remove multiple configs
  3. *
  4. * @param scope scope specification of the entity set to query (e.g. cluster, resource,
  5. * participant, etc.)
  6. * @param recordToRemove the ZNRecord that holds the entries that needs to be removed
  7. */
  8. public void remove(HelixConfigScope scope, ZNRecord recordToRemove) {
  9. if (scope == null || scope.getType() == null || !scope.isFullKey()) {
  10. LOG.error("fail to remove. invalid scope: " + scope);
  11. return;
  12. }
  13. String clusterName = scope.getClusterName();
  14. if (!ZKUtil.isClusterSetup(clusterName, zkClient)) {
  15. throw new HelixException("fail to remove. cluster " + clusterName + " is not setup yet");
  16. }
  17. String zkPath = scope.getZkPath();
  18. ZKUtil.subtract(zkClient, zkPath, recordToRemove);
  19. }

代码示例来源:origin: org.apache.helix/helix-core

  1. ZKUtil.subtract(zkClient, zkPath, update);

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

  1. ZKUtil.subtract(zkClient, zkPath, update);

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

  1. @Test()
  2. public void testSubtract() {
  3. String path = PropertyPathBuilder.instanceConfig(clusterName, "id5");
  4. ZNRecord record = new ZNRecord("id5");
  5. record.setSimpleField("key1", "value1");
  6. _gZkClient.createPersistent(path, record);
  7. ZKUtil.subtract(_gZkClient, path, record);
  8. record = _gZkClient.readData(path);
  9. AssertJUnit.assertNull(record.getSimpleField("key1"));
  10. }

相关文章