gpt4 book ai didi

com.yammer.breakerbox.turbine.YamlInstanceDiscovery类的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 17:50:31 28 4
gpt4 key购买 nike

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

YamlInstanceDiscovery介绍

暂无

代码示例

代码示例来源:origin: yammer/breakerbox

public YamlInstanceDiscovery(Path path,
               Validator validator,
               ObjectMapper objectMapper) {
  this.path = path;
  this.configurationFactory = new YamlConfigurationFactory<>(
      YamlInstanceConfiguration.class,
      validator,
      objectMapper,
      "dw");
  parseYamlInstanceConfiguration();
}

代码示例来源:origin: yammer/breakerbox

private static InstanceDiscovery createClassInstance(Class<InstanceDiscovery> instanceDiscoveryClass,
                          BreakerboxServiceConfiguration configuration,
                          Environment environment) throws Exception {
    if(instanceDiscoveryClass.equals(RancherInstanceDiscovery.class)
       && configuration.getRancherInstanceConfiguration().isPresent()) {
      return new RancherInstanceDiscovery(configuration.getRancherInstanceConfiguration().get(), environment.getObjectMapper());
    } else if (instanceDiscoveryClass.equals(YamlInstanceDiscovery.class)) {
      return new YamlInstanceDiscovery(configuration.getTurbine(), environment.getValidator(), environment.getObjectMapper());
    }
    else if (instanceDiscoveryClass.equals(MarathonInstanceDiscovery.class) && configuration.getMarathonClientConfiguration().isPresent()){
      return new MarathonInstanceDiscovery(environment.getObjectMapper(),configuration.getMarathonClientConfiguration().get());
    }
    return instanceDiscoveryClass.getConstructor().newInstance();
  }
}

代码示例来源:origin: yammer/breakerbox

private static void setupInstanceDiscovery(BreakerboxServiceConfiguration configuration,
                      Environment environment) {
  final Optional<InstanceDiscovery> customInstanceDiscovery = createInstanceDiscovery(configuration, environment);
  if (customInstanceDiscovery.isPresent()) {
    if(configuration.getHystrixStreamSuffix().isPresent()){
      PluginsFactory.setInstanceDiscovery(RegisterClustersInstanceDiscoveryWrapper.wrap(
          customInstanceDiscovery.get(),configuration.getHystrixStreamSuffix().get()));
    } else {
      PluginsFactory.setInstanceDiscovery(RegisterClustersInstanceDiscoveryWrapper.wrap(
          customInstanceDiscovery.get()));
    }
  } else {
    final YamlInstanceDiscovery yamlInstanceDiscovery = new YamlInstanceDiscovery(
        configuration.getTurbine(), environment.getValidator(), environment.getObjectMapper());
    PluginsFactory.setInstanceDiscovery(RegisterClustersInstanceDiscoveryWrapper.wrap(yamlInstanceDiscovery));
  }
}

代码示例来源:origin: yammer/breakerbox

@Override
public Collection<Instance> getInstanceList() throws Exception {
  return parseYamlInstanceConfiguration()
      .orElse(new YamlInstanceConfiguration())
      .getAllInstances();
}

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