gpt4 book ai didi

com.github.dapeng.registry.zookeeper.ZkServiceInfo.freqControl()方法的使用及代码示例

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

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

ZkServiceInfo.freqControl介绍

暂无

代码示例

代码示例来源:origin: dapeng-soa/dapeng-soa

/**
 * 获取 zookeeper 上的 限流规则 freqRule
 *
 * @return
 */
private void syncZkFreqControl(ZkServiceInfo serviceInfo) {
  if (!ZkUtils.isZkReady(zk)) return;
  try {
    Stat stat = new Stat();
    byte[] data = zk.getData(FREQ_PATH + "/" + serviceInfo.serviceName(), this, stat);
    serviceInfo.freqControl(ZkDataProcessor.processFreqRuleData(serviceInfo.serviceName(), data));
  } catch (KeeperException | InterruptedException e) {
    LOGGER.error(getClass() + "::syncZkFreqControl 获取freq 节点: " + serviceInfo.serviceName() + " 出现异常, zkStatus:" + zk.getState(), e);
  }
}

代码示例来源:origin: com.github.dapeng-soa/dapeng-container-impl

final ZkServiceInfo serviceInfo = serverZkAgent.getZkServiceInfo(false, context.getHeader().getServiceName());
if (serviceInfo == null || serviceInfo.freqControl() == null) {
  return true;
final ServiceFreqControl freqControl = serviceInfo.freqControl();
String method = context.getHeader().getMethodName();
if (freqControl.globalRules.isEmpty() && !freqControl.rules4methods.containsKey(method)) {

代码示例来源:origin: dapeng-soa/dapeng-soa

final ZkServiceInfo serviceInfo = serverZkAgent.getZkServiceInfo(false, context.getHeader().getServiceName());
if (serviceInfo == null || serviceInfo.freqControl() == null) {
  return true;
final ServiceFreqControl freqControl = serviceInfo.freqControl();
String method = context.getHeader().getMethodName();
if (freqControl.globalRules.isEmpty() && !freqControl.rules4methods.containsKey(method)) {

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