gpt4 book ai didi

org.apache.eagle.alert.config.ZKConfig类的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 12:16:31 26 4
gpt4 key购买 nike

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

ZKConfig介绍

[英]Memory representation of key zookeeper configurations.
[中]关键zookeeper配置的内存表示。

代码示例

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

public static ZKConfig getZKConfig(Config config) {
    ZKConfig zkConfig = new ZKConfig();
    zkConfig.zkQuorum = config.getString("zkConfig.zkQuorum");
    zkConfig.zkRoot = config.getString("zkConfig.zkRoot");
    zkConfig.zkSessionTimeoutMs = config.hasPath("zkConfig.zkSessionTimeoutMs") ? config.getInt("zkConfig.zkSessionTimeoutMs") : 10000;
    zkConfig.connectionTimeoutMs = config.hasPath("zkConfig.connectionTimeoutMs") ? config.getInt("zkConfig.connectionTimeoutMs") : 10000;
    zkConfig.zkRetryTimes = config.hasPath("zkConfig.zkRetryTimes") ? config.getInt("zkConfig.zkRetryTimes") : 3;
    zkConfig.zkRetryInterval = config.hasPath("zkConfig.zkRetryInterval") ? config.getInt("zkConfig.zkRetryInterval") : 3000;
    return zkConfig;
  }
}

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

ZKConfig zkConfig = new ZKConfig();
zkConfig.zkQuorum = "127.0.0.1:2181";
zkConfig.zkRetryTimes = 3;

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

@Before
public void setUp() throws Exception {
  server = new TestingServer();
  config = new ZKConfig();
  config.zkQuorum = server.getConnectString();
  config.zkRoot = "/alert";
  config.zkRetryInterval = 1000;
  config.zkRetryTimes = 3;
  config.connectionTimeoutMs = 3000;
  config.zkSessionTimeoutMs = 10000;
  producer = new ConfigBusProducer(config);
  consumer = new ConfigBusConsumer(config, topic, value -> {
    validate.set(value.isValueVersionId());
    configValue.set((String) value.getValue());
    System.out.println("******** get notified of config " + value);
  });
}

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