gpt4 book ai didi

com.salesforce.kafka.test.ZookeeperTestServer类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 12:45:27 25 4
gpt4 key购买 nike

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

ZookeeperTestServer介绍

[英]Wrapper around TestingServer zookeeper test server instance.
[中]包装TestingServer zookeeper测试服务器实例。

代码示例

代码示例来源:origin: salesforce/kafka-junit

/**
 * Alias for stop().
 */
@Override
public void close() {
  stop();
}

代码示例来源:origin: salesforce/kafka-junit

/**
 * Returns connection string for zookeeper clients.
 * @return Connection string to connect to the Zookeeper instance.
 */
public String getZookeeperConnectString() {
  return zkTestServer.getConnectString();
}

代码示例来源:origin: salesforce/kafka-junit

zookeeperTestServer = new ZookeeperTestServer();
  zookeeperTestServer.restart();
} else {
  zookeeperTestServer.start();
  setPropertyIfNotSet(brokerProperties, "zookeeper.connect", zookeeperTestServer.getConnectString());

代码示例来源:origin: salesforce/kafka-junit

/**
 * Here we stand up an internal test zookeeper service.
 * once for all tests that use this shared resource.
 * @throws RuntimeException on startup errors.
 */
private void before() throws RuntimeException {
  getZookeeperTestServer().start();
}

代码示例来源:origin: com.salesforce.kafka.test/kafka-junit4

/**
 * Here we stand up an internal test zookeeper service.
 * once for all tests that use this shared resource.
 * @throws RuntimeException on startup errors.
 */
private void before() throws RuntimeException {
  getZookeeperTestServer().start();
}

代码示例来源:origin: salesforce/kafka-junit

/**
 * Here we shut down the internal test zookeeper service.
 * @throws RuntimeException on shutdown errors.
 */
private void after() throws RuntimeException {
  getZookeeperTestServer().stop();
}

代码示例来源:origin: salesforce/kafka-junit

/**
 * Here we stand up an internal test zookeeper service.
 * once for all tests that use this shared resource.
 * @throws RuntimeException on startup errors.
 */
@Override
public void beforeAll(ExtensionContext context) throws RuntimeException {
  getZookeeperTestServer().start();
}

代码示例来源:origin: salesforce/kafka-junit

/**
   * Returns connection string for zookeeper clients.
   * @return Connection string to connect to the Zookeeper instance.
   * @throws IllegalStateException if before() has not been called yet.
   */
  public String getZookeeperConnectString() throws IllegalStateException {
    return zookeeperTestServer.getConnectString();
  }
}

代码示例来源:origin: com.salesforce.kafka.test/kafka-junit4

/**
 * Here we shut down the internal test zookeeper service.
 * @throws RuntimeException on shutdown errors.
 */
private void after() throws RuntimeException {
  getZookeeperTestServer().stop();
}

代码示例来源:origin: salesforce/kafka-junit

/**
 * Restarts the internal Test zookeeper server instance.
 */
public void restart() {
  // If we have no instance yet
  if (zkServer == null) {
    // Call start instead and return.
    start();
    return;
  }
  // Otherwise call restart.
  try {
    zkServer.restart();
  } catch (final Exception exception) {
    throw new RuntimeException(exception.getMessage(), exception);
  }
}

代码示例来源:origin: salesforce/kafka-junit

/**
 * Returns properly formatted zookeeper connection string for zookeeper clients.
 * @return Connect string to use for Zookeeper clients.
 */
public String getZookeeperConnectString() {
  validateState(true, "Cannot get connect string prior to service being started.");
  return zookeeperTestServer.getConnectString();
}

代码示例来源:origin: salesforce/kafka-junit

/**
   * Here we shut down the internal test zookeeper service.
   * @throws RuntimeException on shutdown errors.
   */
  @Override
  public void afterAll(ExtensionContext context) {
    getZookeeperTestServer().stop();
  }
}

代码示例来源:origin: salesforce/kafka-junit

/**
 * Shuts the cluster down.
 * @throws Exception on shutdown errors.
 */
public void stop() throws Exception {
  // Loop over brokers
  for (final KafkaTestServer kafkaBroker : brokers) {
    kafkaBroker.stop();
  }
  // Stop zkServer
  zkTestServer.stop();
}

代码示例来源:origin: salesforce/kafka-junit

/**
 * Closes the internal servers. Failing to call this at the end of your tests will likely
 * result in leaking instances.
 * @throws Exception on shutdown errors.
 */
@Override
public void close() throws Exception {
  if (broker != null) {
    // Shutdown and reset.
    broker.shutdown();
  }
  // Conditionally close zookeeper
  if (zookeeperTestServer != null && isManagingZookeeper) {
    // Call stop() on zk server instance.  This will not cleanup temp data.
    zookeeperTestServer.stop();
  }
}

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