热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicsDescriptor类的使用及代码示例

本文整理了Java中org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicsDescriptor

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

KafkaTopicsDescriptor介绍

[英]A Kafka Topics Descriptor describes how the consumer subscribes to Kafka topics - either a fixed list of topics, or a topic pattern.
[中]卡夫卡主题描述符描述消费者订阅卡夫卡主题的方式-主题的固定列表或主题模式。

代码示例

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

PartitionInfoFetcher(List topics, Properties properties) {
// we're only using partial functionality of the partition discoverer; the subtask id arguments doesn't matter
this.partitiOnDiscoverer= new Kafka08PartitionDiscoverer(new KafkaTopicsDescriptor(topics, null), 0, 1, properties);
this.topics = topics;
}

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

if (topicsDescriptor.isFixedTopics()) {
newDiscoveredPartitiOns= getAllPartitionsForTopics(topicsDescriptor.getFixedTopics());
} else {
List matchedTopics = getAllTopics();
if (!topicsDescriptor.getTopicPattern().matcher(iter.next()).matches()) {
iter.remove();

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

@Override
protected List getAllTopics() {
assertTrue(topicsDescriptor.isTopicPattern());
return mockGetAllTopicsReturnSequence.get(getAllTopicsInvokeCount++);
}

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

@Override
protected List getAllPartitionsForTopics(List topics) {
if (topicsDescriptor.isFixedTopics()) {
assertEquals(topicsDescriptor.getFixedTopics(), topics);
} else {
assertEquals(mockGetAllTopicsReturnSequence.get(getAllPartitionsForTopicsInvokeCount - 1), topics);
}
return mockGetAllPartitionsForTopicsReturnSequence.get(getAllPartitionsForTopicsInvokeCount++);
}

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

public FailingPartitionDiscoverer(RuntimeException failureCause) {
super(
new KafkaTopicsDescriptor(Arrays.asList("foo"), null),
0,
1);
this.failureCause = failureCause;
}

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

if (topicsDescriptor.isFixedTopics()) {
newDiscoveredPartitiOns= getAllPartitionsForTopics(topicsDescriptor.getFixedTopics());
} else {
List matchedTopics = getAllTopics();
if (!topicsDescriptor.getTopicPattern().matcher(iter.next()).matches()) {
iter.remove();

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

@Parameterized.Parameters(name = "KafkaTopicsDescriptor = {0}")
@SuppressWarnings("unchecked")
public static Collection timeCharacteristic(){
return Arrays.asList(
new KafkaTopicsDescriptor[]{new KafkaTopicsDescriptor(Collections.singletonList(TEST_TOPIC), null)},
new KafkaTopicsDescriptor[]{new KafkaTopicsDescriptor(null, Pattern.compile(TEST_TOPIC_PATTERN))});
}

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

if (topicsDescriptor.isFixedTopics()) {
newDiscoveredPartitiOns= getAllPartitionsForTopics(topicsDescriptor.getFixedTopics());
} else {
List matchedTopics = getAllTopics();
if (!topicsDescriptor.getTopicPattern().matcher(iter.next()).matches()) {
iter.remove();

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

/**
* Base constructor.
*
* @param topics fixed list of topics to subscribe to (null, if using topic pattern)
* @param topicPattern the topic pattern to subscribe to (null, if using fixed topics)
* @param deserializer The deserializer to turn raw byte messages into Java/Scala objects.
* @param discoveryIntervalMillis the topic / partition discovery interval, in
* milliseconds (0 if discovery is disabled).
*/
public FlinkKafkaConsumerBase(
List topics,
Pattern topicPattern,
KeyedDeserializationSchema deserializer,
long discoveryIntervalMillis,
boolean useMetrics) {
this.topicsDescriptor = new KafkaTopicsDescriptor(topics, topicPattern);
this.deserializer = checkNotNull(deserializer, "valueDeserializer");
checkArgument(
discoveryIntervalMillis == PARTITION_DISCOVERY_DISABLED || discoveryIntervalMillis >= 0,
"Cannot define a negative value for the topic / partition discovery interval.");
this.discoveryIntervalMillis = discoveryIntervalMillis;
this.useMetrics = useMetrics;
}

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

private DummyPartitionDiscoverer() {
super(new KafkaTopicsDescriptor(Collections.singletonList("foo"), null), 0, 1);
this.allTopics = Collections.singletonList("foo");
this.allPartitiOns= Collections.singletonList(new KafkaTopicPartition("foo", 0));
}

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

new KafkaTopicsDescriptor(Collections.singletonList("test-topic"), null),
i,
initialParallelism,
new KafkaTopicsDescriptor(Collections.singletonList("test-topic"), null),
i,
restoredParallelism,

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

PartitionInfoFetcher(List topics, Properties properties) {
// we're only using partial functionality of the partition discoverer; the subtask id arguments doesn't matter
this.partitiOnDiscoverer= new Kafka08PartitionDiscoverer(new KafkaTopicsDescriptor(topics, null), 0, 1, properties);
this.topics = topics;
}

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

PartitionInfoFetcher(List topics, Properties properties) {
// we're only using partial functionality of the partition discoverer; the subtask id arguments doesn't matter
this.partitiOnDiscoverer= new Kafka08PartitionDiscoverer(new KafkaTopicsDescriptor(topics, null), 0, 1, properties);
this.topics = topics;
}

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

/**
* Base constructor.
*
* @param topics fixed list of topics to subscribe to (null, if using topic pattern)
* @param topicPattern the topic pattern to subscribe to (null, if using fixed topics)
* @param deserializer The deserializer to turn raw byte messages into Java/Scala objects.
* @param discoveryIntervalMillis the topic / partition discovery interval, in
* milliseconds (0 if discovery is disabled).
*/
public FlinkKafkaConsumerBase(
List topics,
Pattern topicPattern,
KeyedDeserializationSchema deserializer,
long discoveryIntervalMillis,
boolean useMetrics) {
this.topicsDescriptor = new KafkaTopicsDescriptor(topics, topicPattern);
this.deserializer = checkNotNull(deserializer, "valueDeserializer");
checkArgument(
discoveryIntervalMillis == PARTITION_DISCOVERY_DISABLED || discoveryIntervalMillis >= 0,
"Cannot define a negative value for the topic / partition discovery interval.");
this.discoveryIntervalMillis = discoveryIntervalMillis;
this.useMetrics = useMetrics;
}

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

/**
* Base constructor.
*
* @param topics fixed list of topics to subscribe to (null, if using topic pattern)
* @param topicPattern the topic pattern to subscribe to (null, if using fixed topics)
* @param deserializer The deserializer to turn raw byte messages into Java/Scala objects.
* @param discoveryIntervalMillis the topic / partition discovery interval, in
* milliseconds (0 if discovery is disabled).
*/
public FlinkKafkaConsumerBase(
List topics,
Pattern topicPattern,
KeyedDeserializationSchema deserializer,
long discoveryIntervalMillis,
boolean useMetrics) {
this.topicsDescriptor = new KafkaTopicsDescriptor(topics, topicPattern);
this.deserializer = checkNotNull(deserializer, "valueDeserializer");
checkArgument(
discoveryIntervalMillis == PARTITION_DISCOVERY_DISABLED || discoveryIntervalMillis >= 0,
"Cannot define a negative value for the topic / partition discovery interval.");
this.discoveryIntervalMillis = discoveryIntervalMillis;
this.useMetrics = useMetrics;
}

推荐阅读
  • 前景:当UI一个查询条件为多项选择,或录入多个条件的时候,比如查询所有名称里面包含以下动态条件,需要模糊查询里面每一项时比如是这样一个数组条件:newstring[]{兴业银行, ... [详细]
  • 本文详细介绍了Spring的JdbcTemplate的使用方法,包括执行存储过程、存储函数的call()方法,执行任何SQL语句的execute()方法,单个更新和批量更新的update()和batchUpdate()方法,以及单查和列表查询的query()和queryForXXX()方法。提供了经过测试的API供使用。 ... [详细]
  • Ihaveaworkfolderdirectory.我有一个工作文件夹目录。holderDir.glob(*)>holder[ProjectOne, ... [详细]
  • 带添加按钮的GridView,item的删除事件
    先上图片效果;gridView无数据时显示添加按钮,有数据时,第一格显示添加按钮,后面显示数据:布局文件:addr_manage.xml<?xmlve ... [详细]
  • 在Android开发中,使用Picasso库可以实现对网络图片的等比例缩放。本文介绍了使用Picasso库进行图片缩放的方法,并提供了具体的代码实现。通过获取图片的宽高,计算目标宽度和高度,并创建新图实现等比例缩放。 ... [详细]
  • Spring源码解密之默认标签的解析方式分析
    本文分析了Spring源码解密中默认标签的解析方式。通过对命名空间的判断,区分默认命名空间和自定义命名空间,并采用不同的解析方式。其中,bean标签的解析最为复杂和重要。 ... [详细]
  • PHP图片截取方法及应用实例
    本文介绍了使用PHP动态切割JPEG图片的方法,并提供了应用实例,包括截取视频图、提取文章内容中的图片地址、裁切图片等问题。详细介绍了相关的PHP函数和参数的使用,以及图片切割的具体步骤。同时,还提供了一些注意事项和优化建议。通过本文的学习,读者可以掌握PHP图片截取的技巧,实现自己的需求。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • 本文主要解析了Open judge C16H问题中涉及到的Magical Balls的快速幂和逆元算法,并给出了问题的解析和解决方法。详细介绍了问题的背景和规则,并给出了相应的算法解析和实现步骤。通过本文的解析,读者可以更好地理解和解决Open judge C16H问题中的Magical Balls部分。 ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • 摘要: 在测试数据中,生成中文姓名是一个常见的需求。本文介绍了使用C#编写的随机生成中文姓名的方法,并分享了相关代码。作者欢迎读者提出意见和建议。 ... [详细]
  • 本文讨论了Kotlin中扩展函数的一些惯用用法以及其合理性。作者认为在某些情况下,定义扩展函数没有意义,但官方的编码约定支持这种方式。文章还介绍了在类之外定义扩展函数的具体用法,并讨论了避免使用扩展函数的边缘情况。作者提出了对于扩展函数的合理性的质疑,并给出了自己的反驳。最后,文章强调了在编写Kotlin代码时可以自由地使用扩展函数的重要性。 ... [详细]
  • Android自定义控件绘图篇之Paint函数大汇总
    本文介绍了Android自定义控件绘图篇中的Paint函数大汇总,包括重置画笔、设置颜色、设置透明度、设置样式、设置宽度、设置抗锯齿等功能。通过学习这些函数,可以更好地掌握Paint的用法。 ... [详细]
  • node.jsurlsearchparamsAPI哎哎哎 ... [详细]
author-avatar
深厚科学修养的文艺青年
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有