kafka.javaapi.TopicMetadata.errorCode()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(105)

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

TopicMetadata.errorCode介绍

暂无

代码示例

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

if (item.errorCode() != ErrorMapping.NoError()) {
    seedBrokerAddresses[currentContactSeedBrokerIndex], topics.toString(), ErrorMapping.exceptionFor(item.errorCode()).getMessage());

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

if (item.errorCode() != ErrorMapping.NoError()) {
    seedBrokerAddresses[currentContactSeedBrokerIndex], topics.toString(), ErrorMapping.exceptionFor(item.errorCode()).getMessage());

代码示例来源:origin: apache/incubator-pinot

final short errorCode = topicMetadata.errorCode();

代码示例来源:origin: linkedin/camus

private TopicMetadataResponse mockTopicMetaDataResponse() {
 PartitionMetadata pMeta = EasyMock.createMock(PartitionMetadata.class);
 mocks.add(pMeta);
 EasyMock.expect(pMeta.errorCode()).andReturn((short)0).anyTimes();
 Broker broker = new Broker(0, "localhost", 2121);
 EasyMock.expect(pMeta.leader()).andReturn(broker).anyTimes();
 EasyMock.expect(pMeta.partitionId()).andReturn(PARTITION_1_ID).anyTimes();
 List<PartitionMetadata> partitionMetadatas = new ArrayList<PartitionMetadata>();
 partitionMetadatas.add(pMeta);    
 TopicMetadata tMeta = EasyMock.createMock(TopicMetadata.class);
 mocks.add(tMeta);
 EasyMock.expect(tMeta.topic()).andReturn(TOPIC_1).anyTimes();
 EasyMock.expect(tMeta.errorCode()).andReturn((short)0).anyTimes();
 EasyMock.expect(tMeta.partitionsMetadata()).andReturn(partitionMetadatas).anyTimes();
 List<TopicMetadata> topicMetadatas = new ArrayList<TopicMetadata>();
 topicMetadatas.add(tMeta);
 TopicMetadataResponse metadataResponse = EasyMock.createMock(TopicMetadataResponse.class);
 mocks.add(metadataResponse);
 EasyMock.expect(metadataResponse.topicsMetadata()).andReturn(topicMetadatas).anyTimes();
 return metadataResponse;
}

代码示例来源:origin: linkedin/camus

} else if (!createMessageDecoder(context, topicMetadata.topic())) {
 log.info("Discarding topic (Decoder generation failed) : " + topicMetadata.topic());
} else if (topicMetadata.errorCode() != ErrorMapping.NoError()) {
 log.info("Skipping the creation of ETL request for Whole Topic : " + topicMetadata.topic() + " Exception : "
   + ErrorMapping.exceptionFor(topicMetadata.errorCode()));
} else {
 for (PartitionMetadata partitionMetadata : topicMetadata.partitionsMetadata()) {

代码示例来源:origin: HomeAdvisor/Kafdrop

private Map<String, TopicVO> getTopicMetadata(BlockingChannel channel, String... topics)
{
 final TopicMetadataRequest request =
   new TopicMetadataRequest((short) 0, 0, clientId(), Arrays.asList(topics));
 LOG.debug("Sending topic metadata request: {}", request);
 channel.send(request);
 final kafka.api.TopicMetadataResponse underlyingResponse =
   kafka.api.TopicMetadataResponse.readFrom(channel.receive().buffer());
 LOG.debug("Received topic metadata response: {}", underlyingResponse);
 TopicMetadataResponse response = new TopicMetadataResponse(underlyingResponse);
 return response.topicsMetadata().stream()
   .filter(tmd -> tmd.errorCode() == ErrorMapping.NoError())
   .map(this::processTopicMetadata)
   .collect(Collectors.toMap(TopicVO::getName, t -> t));
}

代码示例来源:origin: org.apache.flink/flink-connector-kafka-0.8_2.11

if (item.errorCode() != ErrorMapping.NoError()) {
    seedBrokerAddresses[currentContactSeedBrokerIndex], topics.toString(), ErrorMapping.exceptionFor(item.errorCode()).getMessage());

代码示例来源:origin: org.apache.flink/flink-connector-kafka-0.8

if (item.errorCode() != ErrorMapping.NoError()) {
    seedBrokerAddresses[currentContactSeedBrokerIndex], topics.toString(), ErrorMapping.exceptionFor(item.errorCode()).getMessage());

代码示例来源:origin: org.apache.flink/flink-connector-kafka-0.8

if (item.errorCode() != ErrorMapping.NoError()) {
    seedBrokerAddresses[currentContactSeedBrokerIndex], topics.toString(), ErrorMapping.exceptionFor(item.errorCode()).getMessage());

代码示例来源:origin: org.apache.flink/flink-connector-kafka-0.8_2.11

if (item.errorCode() != ErrorMapping.NoError()) {
    seedBrokerAddresses[currentContactSeedBrokerIndex], topics.toString(), ErrorMapping.exceptionFor(item.errorCode()).getMessage());

代码示例来源:origin: org.apache.flink/flink-connector-kafka-0.8_2.10

if (item.errorCode() != ErrorMapping.NoError()) {
      "for " + topics.toString() + ". Error: " + ErrorMapping.exceptionFor(item.errorCode()).getMessage());
  continue brokersLoop;

代码示例来源:origin: Microsoft/Availability-Monitor-for-Kafka

item.topic(),
        JavaConversions.asScalaBuffer(pml).toList(),
        item.errorCode());
ret.add(new kafka.javaapi.TopicMetadata(tm));

代码示例来源:origin: com.linkedin.camus/camus-etl-kafka

} else if (!createMessageDecoder(context, topicMetadata.topic())) {
 log.info("Discarding topic (Decoder generation failed) : " + topicMetadata.topic());
} else if (topicMetadata.errorCode() != ErrorMapping.NoError()) {
 log.info("Skipping the creation of ETL request for Whole Topic : " + topicMetadata.topic() + " Exception : "
   + ErrorMapping.exceptionFor(topicMetadata.errorCode()));
} else {
 for (PartitionMetadata partitionMetadata : topicMetadata.partitionsMetadata()) {

代码示例来源:origin: HiveKa/HiveKa

log.info("Discarding topic (Decoder generation failed) : "
      + topicMetadata.topic());
} else if (topicMetadata.errorCode() != ErrorMapping.NoError()) {
 log.info("Skipping the creation of ETL request for Whole Topic : "
   + topicMetadata.topic()
   + ErrorMapping
       .exceptionFor(topicMetadata
           .errorCode()));
} else {
  for (PartitionMetadata partitionMetadata : topicMetadata

相关文章

微信公众号

最新文章

更多