gpt4 book ai didi

com.netflix.curator.utils.ZKPaths.getNodeFromPath()方法的使用及代码示例

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

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

ZKPaths.getNodeFromPath介绍

[英]Given a full path, return the node name. i.e. "/one/two/three" will return "three"
[中]给定完整路径,返回节点名称。i、 e.“/one/two/three”将返回“three”

代码示例

代码示例来源:origin: com.netflix.curator/curator-recipes

private boolean internalLeave(long startMs, boolean hasMaxWait, long maxWaitMs) throws Exception
  String          ourPathName = ZKPaths.getNodeFromPath(ourPath);
  boolean         ourNodeShouldExist = true;
  boolean         result = true;

代码示例来源:origin: com.netflix.curator/curator-framework

sendBackgroundResponse(KeeperException.Code.OK.intValue(), createdPath, backgrounding.getContext(), ZKPaths.getNodeFromPath(createdPath), this);

代码示例来源:origin: com.netflix.curator/curator-recipes

private void checkLeadership(List<String> children) throws Exception
  int             ourIndex = (ourPath != null) ? sortedChildren.indexOf(ZKPaths.getNodeFromPath(ourPath)) : -1;
  if ( ourIndex < 0 )

代码示例来源:origin: com.netflix.curator/curator-recipes

String                      nodeName = ZKPaths.getNodeFromPath(path);
builder.add(makeLease(path));

代码示例来源:origin: com.netflix.curator/curator-recipes

private void applyNewData(String fullPath, int resultCode, Stat stat, byte[] bytes)
{
  if ( resultCode == KeeperException.Code.OK.intValue() ) // otherwise - node must have dropped or something - we should be getting another event
  {
    ChildData data = new ChildData(fullPath, stat, bytes);
    ChildData previousData = currentData.put(fullPath, data);
    if ( previousData == null ) // i.e. new
    {
      offerOperation(new EventOperation(this, new PathChildrenCacheEvent(PathChildrenCacheEvent.Type.CHILD_ADDED, data)));
    }
    else if ( previousData.getStat().getVersion() != stat.getVersion() )
    {
      offerOperation(new EventOperation(this, new PathChildrenCacheEvent(PathChildrenCacheEvent.Type.CHILD_UPDATED, data)));
    }
    updateInitialSet(ZKPaths.getNodeFromPath(fullPath), data);
  }
}

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