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

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

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

ZKClient.getConnectString介绍

[英]Returns the connection string used for connecting to Zookeeper.
[中]返回用于连接Zookeeper的连接字符串。

代码示例

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

public NamespaceZKClient(ZKClient delegate, String namespace) {
 super(delegate);
 this.namespace = namespace;
 this.delegate = delegate;
 this.connectString = delegate.getConnectString() + namespace;
}

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

@Override
public String getConnectString() {
 return delegate.getConnectString();
}

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

@Override
 public void onFailure(Throwable t) {
  // Just log
  LOG.error("Failed to getData on ZK node {}{}", zkClient.getConnectString(), path, t);
 }
}), executor);

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

@Override
 public void onFailure(Throwable t) {
  LOG.error("Failed to call exists on ZK {}{}", zkClient.getConnectString(), zkPath, t);
  doNotifyFailed(t);
 }
}), Threads.SAME_THREAD_EXECUTOR);

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

@Override
 public void onFailure(Throwable t) {
  // If the resource path node doesn't exists, resort to watch for exists.
  if (t instanceof KeeperException.NoNodeException) {
   beginWatch(watcher);
  }
  // Otherwise, it's a unexpected failure.
  LOG.error("Failed to getChildren on ZK node {}{}",
       zkClient.getConnectString(), CoordinationConstants.REQUIREMENTS_PATH, t);
  doNotifyFailed(t);
 }
}), executor);

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

@Override
 public void onFailure(Throwable t) {
  // Something very wrong to have exists call failed.
  LOG.error("Failed to call exists on ZK node {}{}",
       zkClient.getConnectString(), CoordinationConstants.REQUIREMENTS_PATH, t);
  doNotifyFailed(t);
 }
}), executor);

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

@Override
 public void onFailure(Throwable t) {
  // If the resource path node doesn't exists, resort to watch for exists.
  if (t instanceof KeeperException.NoNodeException) {
   beginWatch(watcher);
  }
  // Otherwise, it's a unexpected failure.
  LOG.error("Failed to getChildren on ZK node {}{}",
       zkClient.getConnectString(), CoordinationConstants.REQUIREMENTS_PATH, t);
  doNotifyFailed(t);
 }
}), executor);

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

@Override
 public void onFailure(Throwable t) {
  // Something very wrong to have exists call failed.
  LOG.error("Failed to call exists on ZK node {}{}",
       zkClient.getConnectString(), CoordinationConstants.REQUIREMENTS_PATH, t);
  doNotifyFailed(t);
 }
}), executor);

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

@Override
 public void onFailure(Throwable t) {
  // Just log
  LOG.error("Failed to getData on ZK node {}{}", zkClient.getConnectString(), path, t);
 }
}), executor);

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

@Override
 public void onFailure(Throwable t) {
  LOG.error("Failed to call exists on ZK {}{}", zkClient.getConnectString(), zkPath, t);
  doNotifyFailed(t);
 }
}), Threads.SAME_THREAD_EXECUTOR);

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

private ApplicationKafkaService(ZKClient zkClient, String kafkaZKConnect) {
 this.zkClient = zkClient;
 this.kafkaServer = new EmbeddedKafkaServer(generateKafkaConfig(kafkaZKConnect));
 this.kafkaZKPath = kafkaZKConnect.substring(zkClient.getConnectString().length());
}

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

@Override
 protected void shutDown() throws Exception {
  LOG.info("Removing container ZK path: {}{}", zkClient.getConnectString(), path);
  ZKOperations.recursiveDelete(zkClient, path).get(TIMEOUT_SECONDS, TimeUnit.SECONDS);
 }
}

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

private OperationFuture<String> removeLiveNode() {
 String liveNode = getLiveNodePath();
 LOG.info("Remove live node {}{}", zkClient.getConnectString(), liveNode);
 return ZKOperations.ignoreError(zkClient.delete(liveNode), KeeperException.NoNodeException.class, liveNode);
}

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

private OperationFuture<String> removeLiveNode() {
 String liveNode = getLiveNodePath();
 LOG.info("Remove live node {}{}", zkClient.getConnectString(), liveNode);
 return ZKOperations.ignoreError(zkClient.delete(liveNode), KeeperException.NoNodeException.class, liveNode);
}

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

@Override
protected void startUp() throws Exception {
 LOG.info("Creating container ZK path: {}{}", zkClient.getConnectString(), path);
 ZKOperations.ignoreError(zkClient.create(path, null, CreateMode.PERSISTENT),
              KeeperException.NodeExistsException.class, null).get(TIMEOUT_SECONDS, TimeUnit.SECONDS);
}

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

/**
 * Creates the live node for the service. If the node already exists, it will be deleted before creation.
 *
 * @return A {@link OperationFuture} that will be completed when the creation is done.
 */
private OperationFuture<String> createLiveNode() {
 final String liveNodePath = getLiveNodePath();
 LOG.info("Creating live node {}{}", zkClient.getConnectString(), liveNodePath);
 return ZKOperations.createDeleteIfExists(zkClient, liveNodePath, serializeLiveNode(), CreateMode.EPHEMERAL, true);
}

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

@Override
protected void startUp() throws Exception {
 // Create the ZK node for Kafka to use. If the node already exists, delete it to make sure there is
 // no left over content from previous AM attempt.
 LOG.info("Preparing Kafka ZK path {}{}", zkClient.getConnectString(), kafkaZKPath);
 ZKOperations.createDeleteIfExists(zkClient, kafkaZKPath, null, CreateMode.PERSISTENT, true).get();
 kafkaServer.startAndWait();
}

代码示例来源: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: apache/twill

/**
 * Creates the live node for the service. If the node already exists, it will be deleted before creation.
 *
 * @return A {@link OperationFuture} that will be completed when the creation is done.
 */
private OperationFuture<String> createLiveNode() {
 final String liveNodePath = getLiveNodePath();
 LOG.info("Creating live node {}{}", zkClient.getConnectString(), liveNodePath);
 return ZKOperations.createDeleteIfExists(zkClient, liveNodePath, serializeLiveNode(), CreateMode.EPHEMERAL, true);
}

相关文章