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

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

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

ZKHelixDataAccessor.getChildNames介绍

暂无

代码示例

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

ZKHelixDataAccessor zkHelixDataAccessor = new ZKHelixDataAccessor(_clusterName, baseDataAccessor);
PropertyKey property = zkHelixDataAccessor.keyBuilder().liveInstances();
List<String> liveInstances = zkHelixDataAccessor.getChildNames(property);

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

accessor.getChildNames(accessor.keyBuilder().idealStates());

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

accessor.getChildNames(accessor.keyBuilder().idealStates());

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

List<String> sessions = _dataAccessor.getChildNames(_keyBuilder.sessions(_instanceName));

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

List<String> sessions = _dataAccessor.getChildNames(_keyBuilder.sessions(_instanceName));

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

public static boolean verifyEmptyCurStateAndExtView(String clusterName, String resourceName,
  Set<String> instanceNames, String zkAddr) {
 HelixZkClient zkClient = SharedZkClientFactory.getInstance()
   .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddr));
 zkClient.setZkSerializer(new ZNRecordSerializer());
 try {
  ZKHelixDataAccessor accessor =
    new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
  Builder keyBuilder = accessor.keyBuilder();
  for (String instanceName : instanceNames) {
   List<String> sessionIds = accessor.getChildNames(keyBuilder.sessions(instanceName));
   for (String sessionId : sessionIds) {
    CurrentState curState =
      accessor.getProperty(keyBuilder.currentState(instanceName, sessionId, resourceName));
    if (curState != null && curState.getRecord().getMapFields().size() != 0) {
     return false;
    }
   }
   ExternalView extView = accessor.getProperty(keyBuilder.externalView(resourceName));
   if (extView != null && extView.getRecord().getMapFields().size() != 0) {
    return false;
   }
  }
  return true;
 } finally {
  zkClient.close();
 }
}

相关文章