org.I0Itec.zkclient.ZkClient.createPersistentSequential()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(153)

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

ZkClient.createPersistentSequential介绍

暂无

代码示例

代码示例来源:origin: ltsopensource/light-task-scheduler

protected String createPersistent(String path, boolean sequential) {
  try {
    if (sequential) {
      return zkClient.createPersistentSequential(path, true);
    } else {
      zkClient.createPersistent(path, true);
      return path;
    }
  } catch (ZkNodeExistsException ignored) {
  }
  return null;
}

代码示例来源:origin: ltsopensource/light-task-scheduler

protected String createPersistent(String path, Object data, boolean sequential) {
  try {
    if (sequential) {
      return zkClient.createPersistentSequential(path, data);
    } else {
      zkClient.createPersistent(path, data);
      return path;
    }
  } catch (ZkNodeExistsException ignored) {
  }
  return null;
}

代码示例来源:origin: ltsopensource/light-task-scheduler

protected String createPersistent(String path, Object data, boolean sequential) {
  try {
    if (sequential) {
      return zkClient.createPersistentSequential(path, data);
    } else {
      zkClient.createPersistent(path, data);
      return path;
    }
  } catch (ZkNodeExistsException ignored) {
  }
  return null;
}

代码示例来源:origin: ltsopensource/light-task-scheduler

protected String createPersistent(String path, boolean sequential) {
  try {
    if (sequential) {
      return zkClient.createPersistentSequential(path, true);
    } else {
      zkClient.createPersistent(path, true);
      return path;
    }
  } catch (ZkNodeExistsException ignored) {
  }
  return null;
}

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

@Override
 public void countDown() {
  // create persistent node
  String path = zkUtils.getZkClient().createPersistentSequential(latchPath + "/", participantId);
  LOG.debug("ZKProcessorLatch countDown created " + path);
 }
}

代码示例来源:origin: com.github.sgroschupf/zkclient

public boolean offer(T element) {
  try {
    _zkClient.createPersistentSequential(_root + "/" + ELEMENT_NAME + "-", element);
  } catch (Exception e) {
    throw ExceptionUtil.convertToRuntimeException(e);
  }
  return true;
}

代码示例来源:origin: com.101tec/zkclient

public boolean offer(T element) {
  try {
    _zkClient.createPersistentSequential(_root + "/" + ELEMENT_NAME + "-", element);
  } catch (Exception e) {
    throw ExceptionUtil.convertToRuntimeException(e);
  }
  return true;
}

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

@Override
 public void countDown() {
  // create persistent node
  String path = zkUtils.getZkClient().createPersistentSequential(latchPath + "/", participantId);
  LOG.debug("ZKProcessorLatch countDown created " + path);
 }
}

代码示例来源:origin: org.apache.samza/samza-core_2.10

@Override
 public void countDown() {
  // create persistent node
  String path = zkUtils.getZkClient().createPersistentSequential(latchPath + "/", participantId);
  LOG.debug("ZKProcessorLatch countDown created " + path);
 }
}

代码示例来源:origin: org.apache.samza/samza-core_2.12

@Override
 public void countDown() {
  // create persistent node
  String path = zkUtils.getZkClient().createPersistentSequential(latchPath + "/", participantId);
  LOG.debug("ZKProcessorLatch countDown created " + path);
 }
}

代码示例来源:origin: org.apache.samza/samza-core_2.11

@Override
 public void countDown() {
  // create persistent node
  String path = zkUtils.getZkClient().createPersistentSequential(latchPath + "/", participantId);
  LOG.debug("ZKProcessorLatch countDown created " + path);
 }
}

代码示例来源:origin: com.github.ltsopensource/lts-core

protected String createPersistent(String path, boolean sequential) {
  try {
    if (sequential) {
      return zkClient.createPersistentSequential(path, true);
    } else {
      zkClient.createPersistent(path, true);
      return path;
    }
  } catch (ZkNodeExistsException ignored) {
  }
  return null;
}

代码示例来源:origin: com.github.ltsopensource/lts-core

protected String createPersistent(String path, Object data, boolean sequential) {
  try {
    if (sequential) {
      return zkClient.createPersistentSequential(path, data);
    } else {
      zkClient.createPersistent(path, data);
      return path;
    }
  } catch (ZkNodeExistsException ignored) {
  }
  return null;
}

代码示例来源:origin: strimzi/strimzi-kafka-operator

/**
 * This notifies Kafka about the changes we have made
 *
 * @param username  Name of the user whose configuration changed
 */
private void notifyChanges(String username) {
  log.debug("Notifying changes for user {}", username);
  ensurePath("/config/changes");
  JsonObject json = new JsonObject().put("version", 2).put("entity_path", "users/" + username);
  zkClient.createPersistentSequential("/config/changes/config_change_", json.encode().getBytes(Charset.defaultCharset()));
}

代码示例来源:origin: com.typesafe.akka/akka-zookeeper-mailbox

public String enqueue(T element) {
 try {
  String sequential = _zkClient.createPersistentSequential(getElementRoughPath(), element);
  String elementId = sequential.substring(sequential.lastIndexOf('/') + 1);
  return elementId;
 } catch (Exception e) {
  throw ExceptionUtil.convertToRuntimeException(e);
 }
}

代码示例来源:origin: appleappleapple/DistributeLearning

/**
 * ṩ
 * @param element
 * @return
 * @throws Exception
 */
public boolean offer(T element) throws Exception{
  
  //ݽڵ·
  String nodeFullPath = root .concat( "/" ).concat( Node_NAME );
  try {
    //־õĽڵ㣬д
    zkClient.createPersistentSequential(nodeFullPath , element);
  }catch (ZkNoNodeException e) {
    zkClient.createPersistent(root);
    offer(element);
  } catch (Exception e) {
    throw ExceptionUtil.convertToRuntimeException(e);
  }
  return true;
}

相关文章