本文整理了Java中org.apache.helix.manager.zk.ZKUtil.subtract()
方法的一些代码示例,展示了ZKUtil.subtract()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKUtil.subtract()
方法的具体详情如下:
包路径:org.apache.helix.manager.zk.ZKUtil
类名称: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"));
}
内容来源于网络,如有侵权,请联系作者删除!