Kafka中Consumer类源码介绍
来源:互联网 发布:陈奕迅专辑 知乎 编辑:程序博客网 时间:2024/05/24 05:44
Kafka中Consumer源码
public interface Consumer<K, V> extends Closeable { void subscribe(String... var1); void subscribe(TopicPartition... var1); void unsubscribe(String... var1); void unsubscribe(TopicPartition... var1); Map<String, ConsumerRecords<K, V>> poll(long var1); OffsetMetadata commit(boolean var1); OffsetMetadata commit(Map<TopicPartition, Long> var1, boolean var2); void seek(Map<TopicPartition, Long> var1); Map<TopicPartition, Long> position(Collection<TopicPartition> var1); Map<TopicPartition, Long> committed(Collection<TopicPartition> var1); Map<TopicPartition, Long> offsetsBeforeTime(long var1, Collection<TopicPartition> var3); Map<MetricName, ? extends Metric> metrics(); void close();}Closeable源码
public interface Closeable { /** * Closes this stream and releases any system resources associated * with it. If the stream is already closed then invoking this * method has no effect. * * @throws IOException if an I/O error occurs */ public void close() throws IOException;}TopicPartition源码
public final class TopicPartition { private int hash = 0; private final int partition; private final String topic; public TopicPartition(String topic, int partition) { this.partition = partition; this.topic = topic; } public int partition() { return this.partition; } public String topic() { return this.topic; } public int hashCode() { if(this.hash != 0) { return this.hash; } else { boolean prime = true; byte result = 1; int result1 = 31 * result + this.partition; result1 = 31 * result1 + (this.topic == null?0:this.topic.hashCode()); this.hash = result1; return result1; } } public boolean equals(Object obj) { if(this == obj) { return true; } else if(obj == null) { return false; } else if(this.getClass() != obj.getClass()) { return false; } else { TopicPartition other = (TopicPartition)obj; if(this.partition != other.partition) { return false; } else { if(this.topic == null) { if(other.topic != null) { return false; } } else if(!this.topic.equals(other.topic)) { return false; } return true; } } } public String toString() { return this.topic + "-" + this.partition; }}
OffsetMetadata源码
public final class OffsetMetadata { private final Map<TopicPartition, Long> offsets; private final Map<TopicPartition, RuntimeException> errors;
ConsumerRecords源码
public class ConsumerRecords<K, V> { private final String topic; private final Map<Integer, List<ConsumerRecord<K, V>>> recordsPerPartition;
MetricName源码
public final class MetricName { private final String name; private final String group; private final String description; private Map<String, String> tags; private int hash;
0 0
- Kafka中Consumer类源码介绍
- Kafka中ConsumerConfig源码介绍
- kafka源码分析之consumer的源码
- kafka源码分析之consumer的源码
- Kafka的Producer和Consumer源码学习
- 37:Kafka源码解读Consumer内幕解密
- 实战录 | Kafka-0.10 Consumer源码解析
- Kafka 0.9 新版本consumer客户端使用介绍
- Kafka 0.9 新版本consumer客户端使用介绍
- 第35课:Kafka源码解读中分区数、Consumer并行度等
- 35:Kafka源码解读中分区数、Consumer并行度等
- kafka consumer
- Kafka-Consumer
- Kafka Consumer
- 第37课:Kafka源码解读Consumer内幕解密
- 跟我学Kafka源码之Consumer分析
- kafka源码分析之kafka的consumer的负载均衡管理
- kafka mq consumer
- JDBC学习(2)jdbc的初实现
- HDU 3448 Bag Problem 暴力枚举,DFS(maybe)
- PAT A 1001 A+B Format
- 缓冲区和数组的输入输出问题
- CSS3 基础(015_媒体查询 - 示例)
- Kafka中Consumer类源码介绍
- 数据的类型
- 二叉树的基本操作
- display ospf peer的输出解释
- Android插件化:从入门到放弃
- GROUP BY,WHERE,HAVING之间的区别和用法
- Jquery的Click函数对WebAPP的支持
- Android常用工具及优秀软件
- spring事务管理复习