66

Kafka 消息格式中的变长字段(Varints)-Java_老男孩

 4 years ago
source link: https://blog.51cto.com/14230003/2399037
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
kafka从0.11.0版本开始所使用的消息格式版本为v2,这个版本的消息相比于v0和v1的版本而言改动很大,同时还参考了ProtocolBuffer而引入了变长整型(Varints)和ZigZag编码。为了更加形象的说明问题,首先我们来了解一下变长整型。Varints是使用一个或多个字节来序列化整数的一种方法。数值越小,其所占用的字节数就越少。Varints中每个字节都有一个位于最高位的msb位

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK