gpt4 book ai didi

com.baidu.disconf.core.common.zookeeper.ZookeeperMgr.writePersistentUrl()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 12:46:20 28 4
gpt4 key购买 nike

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

ZookeeperMgr.writePersistentUrl介绍

暂无

代码示例

代码示例来源:origin: knightliao/disconf

/**
 * Zoo的新建目录
 *
 * @param dir
 */
public void makeDir(String dir, String data) {
  try {
    boolean deafult_path_exist = store.exists(dir);
    if (!deafult_path_exist) {
      LOGGER.info("create: " + dir);
      this.writePersistentUrl(dir, data);
    } else {
    }
  } catch (KeeperException e) {
    LOGGER.error("cannot create path: " + dir, e);
  } catch (Exception e) {
    LOGGER.error("cannot create path: " + dir, e);
  }
}

代码示例来源:origin: knightliao/disconf

/**
   * 写结点
   */
  @Test
  public final void testWritePersistentUrl() {

    try {

      Random random = new Random();
      int randomInt = random.nextInt();

      // 写
      String url = "/disconfserver/dan_dnwebbilling_1_0_online";
      ZookeeperMgr.getInstance().writePersistentUrl(url, String.valueOf(randomInt));

      // 读
      String readData = ZookeeperMgr.getInstance().readUrl(url, null);
      Assert.assertEquals(String.valueOf(randomInt), readData);

    } catch (Exception e) {
      Assert.assertTrue(false);
    }
  }
}

代码示例来源:origin: com.baidu.disconf/disconf-core

/**
 * Zoo的新建目录
 *
 * @param dir
 */
public void makeDir(String dir, String data) {
  try {
    boolean deafult_path_exist = store.exists(dir);
    if (!deafult_path_exist) {
      LOGGER.info("create: " + dir);
      this.writePersistentUrl(dir, data);
    } else {
    }
  } catch (KeeperException e) {
    LOGGER.error("cannot create path: " + dir, e);
  } catch (Exception e) {
    LOGGER.error("cannot create path: " + dir, e);
  }
}

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