gpt4 book ai didi

org.apache.curator.utils.ZKPaths.fixForNamespace()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 05:28:40 26 4
gpt4 key购买 nike

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

ZKPaths.fixForNamespace介绍

[英]Apply the namespace to the given path
[中]

代码示例

代码示例来源:origin: spotify/helios

@Override
public void delete(final String path, final int version) throws KeeperException {
 assertClusterIdFlagTrue();
 final String namespace = emptyToNull(client.getNamespace());
 final String namespacedPath = ZKPaths.fixForNamespace(namespace, path);
 try {
  client.getZookeeperClient().getZooKeeper().delete(namespacedPath, version);
 } catch (Exception e) {
  throwIfInstanceOf(e, KeeperException.class);
  throw new RuntimeException(e);
 }
}

代码示例来源:origin: org.apache.curator/curator-framework

String    fixForNamespace(String path, boolean isSequential)
{
  if ( ensurePathNeeded.get() )
  {
    try
    {
      final CuratorZookeeperClient zookeeperClient = client.getZookeeperClient();
      RetryLoop.callWithRetry
      (
        zookeeperClient,
        new Callable<Object>()
        {
          @Override
          public Object call() throws Exception
          {
            ZKPaths.mkdirs(zookeeperClient.getZooKeeper(), ZKPaths.makePath("/", namespace), true, client.getAclProvider(), true);
            return null;
          }
        }
      );
      ensurePathNeeded.set(false);
    }
    catch ( Exception e )
    {
      ThreadUtils.checkInterrupted(e);
      client.logError("Ensure path threw exception", e);
    }
  }
  return ZKPaths.fixForNamespace(namespace, path, isSequential);
}

代码示例来源:origin: xiancloud/xian

/**
 * Apply the namespace to the given path
 *
 * @param namespace namespace (can be null)
 * @param path      path
 * @return adjusted path
 */
public static String fixForNamespace(String namespace, String path)
{
  return fixForNamespace(namespace, path, false);
}

代码示例来源:origin: org.apache.curator/curator-client

/**
 * Apply the namespace to the given path
 *
 * @param namespace namespace (can be null)
 * @param path      path
 * @return adjusted path
 */
public static String fixForNamespace(String namespace, String path)
{
  return fixForNamespace(namespace, path, false);
}

代码示例来源:origin: at.molindo/helios-services

final String namespacedPath = ZKPaths.fixForNamespace(namespace, path);

代码示例来源:origin: at.molindo/helios-services

@Override
public void delete(final String path, final int version) throws KeeperException {
 assertClusterIdFlagTrue();
 final String namespace = emptyToNull(client.getNamespace());
 final String namespacedPath = ZKPaths.fixForNamespace(namespace, path);
 try {
  client.getZookeeperClient().getZooKeeper().delete(namespacedPath, version);
 } catch (Exception e) {
  propagateIfInstanceOf(e, KeeperException.class);
  throw propagate(e);
 }
}

代码示例来源:origin: info.xiancloud/xian-curator-framework

String    fixForNamespace(String path, boolean isSequential)
{
  if ( ensurePathNeeded.get() )
  {
    try
    {
      final CuratorZookeeperClient zookeeperClient = client.getZookeeperClient();
      RetryLoop.callWithRetry
      (
        zookeeperClient,
        new Callable<Object>()
        {
          @Override
          public Object call() throws Exception
          {
            ZKPaths.mkdirs(zookeeperClient.getZooKeeper(), ZKPaths.makePath("/", namespace), true, client.getAclProvider(), true);
            return null;
          }
        }
      );
      ensurePathNeeded.set(false);
    }
    catch ( Exception e )
    {
      ThreadUtils.checkInterrupted(e);
      client.logError("Ensure path threw exception", e);
    }
  }
  return ZKPaths.fixForNamespace(namespace, path, isSequential);
}

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