gpt4 book ai didi

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

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

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

Zone.defaultZone介绍

[英]Do not use
[中]不要使用

代码示例

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

public VespaModelFactory(Version version, ConfigModelRegistry configModelRegistry, Clock clock) {
  this.version = version;
  if (configModelRegistry == null) {
    this.configModelRegistry = new NullConfigModelRegistry();
    log.info("Will not load config models from plugins, as no registry is available");
  } else {
    this.configModelRegistry = configModelRegistry;
  }
  this.modelImporters = Collections.emptyList();
  this.zone = Zone.defaultZone();
  this.clock = clock;
}

代码示例来源: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/node-repository

/**
 * Constructor
 * @param flavors flavors to have in node repo
 */
public MockNodeRepository(MockCurator curator, NodeFlavors flavors) {
  super(flavors, curator, Clock.fixed(Instant.ofEpochMilli(123), ZoneId.of("Z")), Zone.defaultZone(),
     new MockNameResolver()
         .addRecord("test-container-1", "::2")
         .mockAnyLookup(),
     new DockerImage("docker-registry.domain.tld:8080/dist/vespa"),
     true);
  this.flavors = flavors;
  curator.setZooKeeperEnsembleConnectionSpec("cfg1:1234,cfg2:1234,cfg3:1234");
  populate();
}

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

/**
 * Returns the distribution bits this cluster should use.
 * On Hosted Vespa this is hardcoded and not computed from the nodes because reducing the number of nodes is a common
 * operation, while reducing the number of distribution bits can lead to consistency problems.
 * This hardcoded value should work fine from 1-200 nodes. Those who have more will need to set this value
 * in config and not remove it again if they reduce the node count.
 */
public int distributionBits() {
  if (zone.environment() == Environment.prod && ! zone.equals(Zone.defaultZone())) {
    return 16;
  }
  else { // hosted test zone, or self-hosted system
    // hosted test zones: have few nodes and use visiting in tests: This is slow with 16 bits (to many buckets)
    // self hosted systems: should probably default to 16 bits, but the transition may cause problems
    return DistributionBitCalculator.getDistributionBits(getNodeCountPerGroup(), getDistributionMode());
  }
}

代码示例来源:origin: com.yahoo.vespa/node-repository

private void populate() {
  NodeRepositoryProvisioner provisioner = new NodeRepositoryProvisioner(this, flavors, Zone.defaultZone(), new MockProvisionServiceProvider());
  List<Node> nodes = new ArrayList<>();

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

this.name = name;
this.isHostedVespa = stateIsHosted(deployState);
this.zone = (deployState != null) ? deployState.zone() : Zone.defaultZone();
componentGroup = new ComponentGroup<>(this, "component");
restApiGroup = new ConfigProducerGroup<>(this, "rest-api");

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