com.spotify.helios.master.ZooKeeperMasterModel.getDeploymentGroupHosts()方法的使用及代码示例

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

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

ZooKeeperMasterModel.getDeploymentGroupHosts介绍

暂无

代码示例

代码示例来源:origin: spotify/helios

private RollingUpdateOp getInitRollingUpdateOps(final DeploymentGroup deploymentGroup,
                        final List<String> updateHosts,
                        final List<String> undeployHosts,
                        final ZooKeeperClient zooKeeperClient)
  throws KeeperException {
 final List<RolloutTask> rolloutTasks = new ArrayList<>();
 // give precedence to the updateHosts list so we don't end up in a state where we updated a host
 // and then removed the job from it (because of buggy logic in the calling method)
 final List<String> updateHostsCopy = new ArrayList<>(updateHosts);
 final List<String> undeployHostsCopy = new ArrayList<>(undeployHosts);
 undeployHostsCopy.removeAll(updateHostsCopy);
 // we only care about hosts that are UP
 final List<String> upHostsToUndeploy = undeployHostsCopy.stream()
   .filter(host -> checkHostUp(zooKeeperClient, host))
   .collect(Collectors.toList());
 final List<String> upHostsToDeploy = updateHostsCopy.stream()
   .filter(host -> checkHostUp(zooKeeperClient, host))
   .collect(Collectors.toList());
 rolloutTasks.addAll(RollingUndeployPlanner.of(deploymentGroup)
   .plan(upHostsToUndeploy));
 rolloutTasks.addAll(RollingUpdatePlanner.of(deploymentGroup)
   .plan(upHostsToDeploy));
 log.info("generated rolloutTasks for deployment-group name={} "
      + "updateHosts={} undeployHosts={}: {}",
   deploymentGroup.getName(), updateHosts, undeployHosts, rolloutTasks);

代码示例来源:origin: at.molindo/helios-services

for (final String host: getDeploymentGroupHosts(deploymentGroup.getName())) {
 hostsAndStatuses.put(host, getHostStatus(host));

相关文章