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

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

本文整理了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

/**
 * Selectively removes fields appearing in the given IdealState (input) from the IdealState in ZK.
 * @param clusterName
 * @param resourceName
 * @param idealState
 */
@Override
public void removeFromIdealState(String clusterName, String resourceName, IdealState idealState) {
 String zkPath = PropertyPathBuilder.idealState(clusterName, resourceName);
 ZKUtil.subtract(_zkClient, zkPath, idealState.getRecord());
}

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

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

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

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

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

/**
 * Remove multiple configs
 *
 * @param scope          scope specification of the entity set to query (e.g. cluster, resource,
 *                       participant, etc.)
 * @param recordToRemove the ZNRecord that holds the entries that needs to be removed
 */
public void remove(HelixConfigScope scope, ZNRecord recordToRemove) {
 if (scope == null || scope.getType() == null || !scope.isFullKey()) {
  LOG.error("fail to remove. invalid scope: " + scope);
  return;
 }
 String clusterName = scope.getClusterName();
 if (!ZKUtil.isClusterSetup(clusterName, zkClient)) {
  throw new HelixException("fail to remove. cluster " + clusterName + " is not setup yet");
 }
 String zkPath = scope.getZkPath();
 ZKUtil.subtract(zkClient, zkPath, recordToRemove);
}

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

/**
 * Remove multiple configs
 *
 * @param scope          scope specification of the entity set to query (e.g. cluster, resource,
 *                       participant, etc.)
 * @param recordToRemove the ZNRecord that holds the entries that needs to be removed
 */
public void remove(HelixConfigScope scope, ZNRecord recordToRemove) {
 if (scope == null || scope.getType() == null || !scope.isFullKey()) {
  LOG.error("fail to remove. invalid scope: " + scope);
  return;
 }
 String clusterName = scope.getClusterName();
 if (!ZKUtil.isClusterSetup(clusterName, zkClient)) {
  throw new HelixException("fail to remove. cluster " + clusterName + " is not setup yet");
 }
 String zkPath = scope.getZkPath();
 ZKUtil.subtract(zkClient, zkPath, recordToRemove);
}

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

ZKUtil.subtract(zkClient, zkPath, update);

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

ZKUtil.subtract(zkClient, zkPath, update);

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

@Test()
public void testSubtract() {
 String path = PropertyPathBuilder.instanceConfig(clusterName, "id5");
 ZNRecord record = new ZNRecord("id5");
 record.setSimpleField("key1", "value1");
 _gZkClient.createPersistent(path, record);
 ZKUtil.subtract(_gZkClient, path, record);
 record = _gZkClient.readData(path);
 AssertJUnit.assertNull(record.getSimpleField("key1"));
}

相关文章