gpt4 book ai didi

org.apache.twill.zookeeper.ZKClient.setData()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 01:36:49 26 4
gpt4 key购买 nike

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

ZKClient.setData介绍

[英]Sets the data for the given path without matching version. Same as calling #setData(String,byte[],int).
[中]设置给定路径的数据,但不匹配版本。与调用#setData(字符串,字节[],int)相同。

代码示例

代码示例来源:origin: org.apache.twill/twill-zookeeper

@Override
public OperationFuture<Stat> setData(String dataPath, byte[] data, int version) {
 return delegate.setData(dataPath, data, version);
}

代码示例来源:origin: org.apache.twill/twill-zookeeper

@Override
public OperationFuture<Stat> setData(String dataPath, byte[] data, int version) {
 return client.setData(dataPath, data, version);
}

代码示例来源:origin: apache/twill

@Override
public OperationFuture<Stat> setData(String dataPath, byte[] data, int version) {
 return delegate.setData(dataPath, data, version);
}

代码示例来源:origin: apache/twill

@Override
public OperationFuture<Stat> setData(String dataPath, byte[] data, int version) {
 return client.setData(dataPath, data, version);
}

代码示例来源:origin: caskdata/coopr

@Override
 public void onFailure(Throwable t) {
  if (causedBy(t, KeeperException.NodeExistsException.class)) {
   OperationFuture<Stat> setDataResult = zkClient.setData(path, data);
   Futures.addCallback(setDataResult, new FutureCallback<Stat>() {
    @Override
    public void onSuccess(Stat result) {
     resultFuture.set(new SetResult(null, result));
    }
    @Override
    public void onFailure(Throwable t) {
     if (causedBy(t, KeeperException.NoNodeException.class)) {
      Futures.addCallback(zkClient.create(path, data, createMode, createParent), createCallback);
      return;
     }
     resultFuture.setException(t);
    }
   });
   return;
  }
  resultFuture.setException(t);
 }
});

代码示例来源:origin: caskdata/cdap

try {
 final T data = dataSupplier.get();
 Futures.addCallback(zkClient.setData(path, codec.encode(data)), new FutureCallback<Stat>() {
  @Override
  public void onSuccess(Stat state) {

代码示例来源:origin: co.cask.cdap/cdap-common

try {
 final T data = dataSupplier.get();
 Futures.addCallback(zkClient.setData(path, codec.encode(data)), new FutureCallback<Stat>() {
  @Override
  public void onSuccess(Stat state) {

代码示例来源:origin: org.apache.twill/twill-core

/**
 * Update the live node for the service.
 *
 * @return A {@link OperationFuture} that will be completed when the update is done.
 */
protected final OperationFuture<?> updateLiveNode() {
 String liveNodePath = getLiveNodePath();
 LOG.info("Update live node {}{}", zkClient.getConnectString(), liveNodePath);
 return zkClient.setData(liveNodePath, serializeLiveNode());
}

代码示例来源:origin: apache/twill

/**
 * Update the live node for the service.
 *
 * @return A {@link OperationFuture} that will be completed when the update is done.
 */
protected final OperationFuture<?> updateLiveNode() {
 String liveNodePath = getLiveNodePath();
 LOG.info("Update live node {}{}", zkClient.getConnectString(), liveNodePath);
 return zkClient.setData(liveNodePath, serializeLiveNode());
}

代码示例来源:origin: caskdata/coopr

private long generateId(Type type) {
 idLock.get().lock();
 try {
  NodeData nodeData = Futures.getUnchecked(zkClient.getData(type.path));
  long counterVal = Longs.fromByteArray(nodeData.getData());
  Futures.getUnchecked(zkClient.setData(type.path, Longs.toByteArray(counterVal + incrementBy)));
  return counterVal;
 } finally {
  idLock.get().unlock();
 }
}

代码示例来源:origin: org.apache.twill/twill-zookeeper

@Override
public OperationFuture<Stat> setData(String dataPath, byte[] data, int version) {
 return relayFuture(delegate.setData(getNamespacedPath(dataPath), data, version), this.<Stat>createFuture(dataPath));
}

代码示例来源:origin: apache/twill

@Override
public OperationFuture<Stat> setData(String dataPath, byte[] data, int version) {
 return relayFuture(delegate.setData(getNamespacedPath(dataPath), data, version), this.<Stat>createFuture(dataPath));
}

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