当前位置:网站首页>Pulsar theme compression
Pulsar theme compression
2022-07-01 02:24:00 【swadian2008】
Catalog
Pulsar Take highly scalable message data persistent storage as the main goal .Pulsar Topics enable you to persist the required number of unacknowledged messages , While preserving the message order . By default ,Pulsar Stores all unacknowledged or unprocessed messages generated on a topic . For many Pulsar scenario , It is necessary to store many unacknowledged messages on a topic , But for the Pulsar Users , In the log of the entire message “ The playback ” It will also become very time-consuming .
A more practical guide to topic compression , see also Topic compaction cookbook.
For some scenarios , Consumers do not need the integrity of the topic log “ Images ”. They may Only a few values are needed to build more “ shallow ” Log image of , You may even need only the latest values . For these types of scenes ,Pulsar Provides theme compression . When you use compression on a topic ,Pulsar Will traverse the message backlog log of the topic , And remove the old message , in other words , It will press each key to traverse the topic , Only the latest news associated with the key is left .
Pulsar The theme compression function of :
- Allows faster... Through topic logs “ The playback ”
- Only for persistent themes
- backlog It will automatically trigger when it reaches a certain size , It can also be triggered manually through the command line .See the Topic compaction cookbook
- Different from reservation in concept and operation (retention) Strategy and expiration (expiry) Strategy . Compared with the theme compression strategy , Retain (retention) Will give priority to . If retention Message deleted from message backlog for topic , Then the message will also not be able to be downloaded from the compressed subject ledger (ledger) Read from .
Topic compression example : Stock market
Pulsar An example scenario for the compression theme is the stock market theme . In the stock symbol topic , The dollar value of each message with a timestamp , Used to buy shares ( The message key contains stock symbols , for example AAPL or GOOG). For the stock market , You may only care about the latest value of the stock , Not interested in historical data ( namely , You don't need to build a complete image of the subject message sequence for each key ). under these circumstances , Compression is very beneficial , Because it can avoid consumers' need to play back in confusing messages .
How topic compaction works
When passed CLI When topic compression is triggered (via the CLI),Pulsar The whole topic will be traversed from beginning to end . For each Key, The compressor will retain this Key The latest record .// CLI : Command line interface ( English :command-line interface, abbreviation :CLI
after ,broker A new ledger will be created (BookKeeper ledger), And perform the second iteration for each message in the topic . For each message Key, If Key Match the latest data , Then Key Payload data for 、 news ID And metadata will be written to the newly created ledger (ledger). If Key Does not match the latest data , The message will be skipped and kept . If the payload of any given message is empty ( For a message key Assign a null value ), It will be skipped and treated as deleted ( Be similar to key-value In the database Tombstone concept -> That is, temporarily mark and delete ). When the second iteration topic ends , The newly created ledger will be closed (BookKeeper ledger), And write the following two contents into the metadata of the topic : Ledger ID(BookKeeper ledger) And the last compressed message ID( A compressed range called a topic compaction horizon). Once this metadata is written , Compression is complete .
After the compression operation is initialized , No matter when it comes to compressed ranges and compressed backlog messages (compacted backlog) Make any changes , Will inform the subject broker, such as :
Client with read compression enabled (consumers and readers) Try to read a message from the topic , also :
- Read the topic as normal ( If the news ID Greater than or equal to the compression range ) perhaps
- Read from the compressed range ( If the news ID Less than the compression range )
边栏推荐
- 2022年最新csdn涨薪技术栈-app自动化测试概述
- SWT / anr problem - deadlock
- 【2022年】江西省研究生数学建模方案、代码
- go导入自建包
- How to learn and read code
- Fix names in the table (first character uppercase, other lowercase)
- Ernie-gram, 显式、完备的 n-gram 掩码语言模型,实现了显式的 n-gram 语义单元知识建模。
- nacos配置中心使用教程
- AI 边缘计算平台 - BeagleBone AI 64 简介
- Pycharm 打开远程目录 Remote Host
猜你喜欢

js中的图片预加载

halcon变量窗口的图像变量不显示,重启软件和电脑都没用

My PMP learning test experience

Video tutorial | Chang'an chain launched a series of video tutorial collections (Introduction)

Electron pit Addon
![Pytorch —— 基础指北_贰 高中生都能看懂的[反向传播和梯度下降]](/img/6e/279dbb7a8d7a5ecd240de464c5b8b2.png)
Pytorch —— 基础指北_贰 高中生都能看懂的[反向传播和梯度下降]

Machine learning 10 belief Bayesian classifier

The whole process of AS400 API from zero to one

How does the property send a text message to the owner?
![[2022] Jiangxi postgraduate mathematical modeling scheme and code](/img/f4/86b0dc2bd49c3a54c1e0538b31d458.png)
[2022] Jiangxi postgraduate mathematical modeling scheme and code
随机推荐
Zero foundation self-study SQL course | window function
SAP ALV汇总跟导出Excel 汇总数据不一致
How to maintain efficient collaboration in remote office and achieve stable growth of projects | community essay solicitation
小程序自定义顶部导航栏,uni-app微信小程序自定义顶部导航栏
LabVIEW计算相机图像传感器分辨率以及镜头焦距
2022年最新csdn涨薪技术栈-app自动化测试概述
端口号和进程号的区别?
Laravel event & Monitoring
修复表中的名字(首字符大写,其他小写)
CorelDRAW 2022中文精简64位直装版下载
Winodws 快速添加开机启动项
Short video platform development, relying on drawerlayout to achieve side sliding menu effect
ANR问题的分析与解决思路
Pulsar Geo Replication/灾备/地域复制
What is project management?
Comment réaliser la liaison entre la serrure intelligente et la lampe, la scène du moteur de rideau intelligent dans le timing intelligent?
522. Longest special sequence II
SWT/ANR问题--Dump时间过长导致的SWT
SWT/ANR问题--AMS/WMS
手机edge浏览器无法打开三方应用