• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java TopicAlreadyMarkedForDeletionException类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中kafka.common.TopicAlreadyMarkedForDeletionException的典型用法代码示例。如果您正苦于以下问题:Java TopicAlreadyMarkedForDeletionException类的具体用法?Java TopicAlreadyMarkedForDeletionException怎么用?Java TopicAlreadyMarkedForDeletionException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

TopicAlreadyMarkedForDeletionException类属于kafka.common包,在下文中一共展示了TopicAlreadyMarkedForDeletionException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testStartFailsOnTopicCreationErrors

点赞 3

import kafka.common.TopicAlreadyMarkedForDeletionException; //导入依赖的package包/类
@Test(expected = TopicAlreadyMarkedForDeletionException.class)
public void testStartFailsOnTopicCreationErrors() {

  KafkaStreamSpec checkpointSpec = new KafkaStreamSpec(CHECKPOINT_TOPIC, CHECKPOINT_TOPIC,
      CHECKPOINT_SYSTEM, 1);
  // create an admin that throws an exception during createStream
  SystemAdmin mockAdmin = newAdmin("0", "10");
  doThrow(new TopicAlreadyMarkedForDeletionException("invalid stream")).when(mockAdmin).createStream(checkpointSpec);

  SystemFactory factory = newFactory(mock(SystemProducer.class), mock(SystemConsumer.class), mockAdmin);
  KafkaCheckpointManager checkpointManager = new KafkaCheckpointManager(checkpointSpec, factory,
      true, mock(Config.class), mock(MetricsRegistry.class), null, new KafkaCheckpointLogKeySerde());

  // expect an exception during startup
  checkpointManager.start();
}
 

开发者ID:apache,
项目名称:samza,
代码行数:17,
代码来源:TestKafkaCheckpointManagerJava.java

示例2: deleteTopic

点赞 2

import kafka.common.TopicAlreadyMarkedForDeletionException; //导入依赖的package包/类
/**
 * Delete topic
 *
 * @return if the topic was deleted or not
 */
public synchronized boolean deleteTopic(String topic) {
  boolean deleted = true;
  try {
    AdminUtils.deleteTopic(getZooKeeperUtils(), topic);
  } catch (TopicAlreadyMarkedForDeletionException topicAlreadyMarkedForDeletionException) {
    deleted = false;
  }
  return deleted && AdminUtils.topicExists(getZooKeeperUtils(), topic);
}
 

开发者ID:ggear,
项目名称:cloudera-framework,
代码行数:15,
代码来源:KafkaServer.java

示例3: deleteTopic

点赞 1

import kafka.common.TopicAlreadyMarkedForDeletionException; //导入依赖的package包/类
/**
 * Delete a Kafka topic.
 *
 * @param topicName name of topic.
 * @return true if the topic has been deleted and false if the topic has not been deleted.
 * @throws kafka.common.KafkaException
 */
public boolean deleteTopic(String topicName) throws KafkaException, TopicAlreadyMarkedForDeletionException {
    logger.debug("Deleting topic with name: " + topicName);
    AdminUtils.deleteTopic(zkUtils, topicName);
    logger.debug("Topic with name: " + topicName + " correctly deleted");
    return !AdminUtils.topicExists(zkUtils, topicName);
}
 

开发者ID:Stratio,
项目名称:bdt,
代码行数:14,
代码来源:KafkaUtils.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)