gpt4 book ai didi

me.hao0.antares.common.util.ZkPaths.lastNode()方法的使用及代码示例

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

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

ZkPaths.lastNode介绍

暂无

代码示例

代码示例来源:origin: ihaolin/antares

@Override
  protected void onDelete(String path) {
    String server = ZkPaths.lastNode(path);
    if(alives.remove(server)){
      notifyListeners(server, false);
      Logs.warn("The server ({}) is left.", server);
    }
  }
});

代码示例来源:origin: ihaolin/antares

@Override
protected void onAdd(String path, byte[] data) {
  String server = ZkPaths.lastNode(path);
  if (!alives.contains(server)){
    alives.add(server);
    notifyListeners(server, true);
    Logs.info("The server ({}) is joined.", server);
  }
}

代码示例来源:origin: ihaolin/antares

@Override
protected void onAdd(String path, byte[] data) {
  String server = ZkPaths.lastNode(path);
  client.addHttpServer(server);
  log.info("The server({}) joined.", server);
}

代码示例来源:origin: ihaolin/antares

@Override
  protected void onDelete(String path) {
    String server = ZkPaths.lastNode(path);
    client.removeHttpServer(server);
    log.info("The server({}) left.", server);
  }
});

代码示例来源:origin: ihaolin/antares

@Override
  protected void onAdd(String path, byte[] data) {
    // fired a new job instance
    String instanceId = ZkPaths.lastNode(path);
    if (Strings.isNullOrEmpty(instanceId)) return;
    // execute the job
    client.getJobExecutor().execute(Long.valueOf(instanceId), ZkJob.this);
  }
});

代码示例来源:origin: ihaolin/antares

@Override
  protected void onDelete(String path) {
    String client = ZkPaths.lastNode(path);
    alives.remove(client);
    onClientChanged(appName, client, false);
    Logs.info("The app({})'s client({}) left.", appName, client);
  }
});

代码示例来源:origin: ihaolin/antares

@Override
protected void onAdd(String path, byte[] data) {
  // not started, or has shutdown
  // prevent multiple redundant notifies before started
  if (!started || shutdowned) {
    return;
  }
  String client = ZkPaths.lastNode(path);
  if (alives.contains(client)){
    return;
  }
  alives.add(client);
  onClientChanged(appName, client, true);
  Logs.info("The app({})'s client({}) joined.", appName, client);
}

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