gpt4 book ai didi

com.yahoo.config.provision.Zone.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 22:15:31 27 4
gpt4 key购买 nike

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

Zone.<init>介绍

[英]Create from environment and region. Use for testing.
[中]从环境和地域中创造。用于测试。

代码示例

代码示例来源:origin: com.yahoo.vespa/standalone-container

private static Zone getZone() {
  if (!isConfigServer()) {
    return Zone.defaultZone();
  }
  CloudConfigInstallVariables cloudConfigVariables = new CloudConfigInstallVariables();
  if (!cloudConfigVariables.hostedVespa().orElse(false)) {
    return Zone.defaultZone();
  }
  RegionName region = cloudConfigVariables.region().map(RegionName::from).orElseGet(RegionName::defaultName);
  Environment environment = cloudConfigVariables.environment().map(Environment::from).orElseGet(Environment::defaultEnvironment);
  SystemName system = cloudConfigVariables.system().map(SystemName::from).orElseGet(SystemName::defaultSystem);
  return new Zone(system, environment, region);
}

代码示例来源:origin: com.yahoo.vespa/config-provisioning

/** Do not use */
public static Zone defaultZone() {
  return new Zone(SystemName.defaultSystem(), Environment.defaultEnvironment(), RegionName.defaultName());
}

代码示例来源:origin: com.yahoo.vespa/config-model

public void setContainerCluster(ContainerCluster containerCluster) {
  this.containerCluster = containerCluster;
  // If we are in a config server cluster the correct zone is propagated through cloud config options,
  // not through config to deployment options (see StandaloneContainerApplication.scala),
  // so we need to propagate the zone options into the container from here
  Environment environment = options.environment().isPresent() ? Environment.from(options.environment().get()) : Environment.defaultEnvironment();
  RegionName region = options.region().isPresent() ? RegionName.from(options.region().get()) : RegionName.defaultName();
  SystemName system = options.system().isPresent() ? SystemName.from(options.system().get()) : SystemName.defaultSystem();
  containerCluster.setZone(new Zone(system, environment, region));
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com