gpt4 book ai didi

org.linkedin.zookeeper.client.ZKData类的使用及代码示例

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

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

ZKData介绍

暂无

代码示例

代码示例来源:origin: org.pongasoft/org.linkedin.zookeeper-impl

/**
 * Returns both the data as a string as well as the stat (and sets a watcher if not null)
 */
@Override
public ZKData<String> getZKStringData(String path, Watcher watcher)
 throws InterruptedException, KeeperException
{
 ZKData<byte[]> zkData = getZKByteData(path, watcher);
 return new ZKData<String>(toStringData(zkData.getData()), zkData.getStat());
}

代码示例来源:origin: org.pongasoft/org.linkedin.zookeeper-impl

new TrackedNode<T>(path, res.getData(), res.getStat(), depth);
if(oldTrackedNode != null)

代码示例来源:origin: org.pongasoft/org.linkedin.zookeeper-impl

/**
 * Returns both the data as a byte[] as well as the stat (and sets a watcher if not null)
 */
@Override
public ZKData<byte[]> getZKByteData(String path, Watcher watcher)
 throws InterruptedException, KeeperException
{
 Stat stat = new Stat();
 return new ZKData<byte[]>(getData(path, watcher, stat), stat);
}

代码示例来源:origin: org.fusesource.fabric/fabric-jaas

protected void fetchData() throws Exception {
  ZKData<String> zkData = zooKeeper.getZKStringData(path, this);
  String value = zkData.getData();
  if (value != null) {
    clear();
    load(new StringReader(value));
  }
}

代码示例来源:origin: org.fusesource.insight/insight-graph

@Override
public ZKData<OutputWriter> readData(org.linkedin.zookeeper.client.IZKClient zkClient, String path, Watcher watcher) throws InterruptedException, KeeperException {
  Stat stat = new Stat();
  Unmarshaller<OutputWriter> unmarshaller = null;
  if (path.endsWith(".json")) {
    unmarshaller = new JsonUnmarshaller<OutputWriter>(OutputWriter.class);
  } else if (path.endsWith(".properties")) {
    unmarshaller = new PropertiesObjectWriterUnmarshaller();
  } else {
    LOG.debug("Ignoring ZK Path: " + path + " as it doesn't end in .json");
    return new ZKData<OutputWriter>(null, stat);
  }
  LOG.info("Reading ZK path: " + path + " and converting to an OutputWriter");
  byte[] data = zkClient.getData(path, watcher, stat);
  try {
    OutputWriter outputWriter = unmarshaller.unmarshal(path, data);
    if (outputWriter != null) {
      configureWriter(outputWriter);
      outputWriter.start();
    }
    return new ZKData<OutputWriter>(outputWriter, stat);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}

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