-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PIP-104: Add new consumer type: TableView #12356
Comments
Will be persist snapshots of tables also ? |
The 1st implementation will be in memory only in the client side. The snapshots can be thought of as the compacted view that are kept in BookKeeper. Later on, we can add more client options, including the possibility to have the possibility to store the state on disk and to internally replay from a specific message id. |
It will be useful when content can store in memory. expecting |
Motivation
In many use cases, applications are using Pulsar consumers or readers to fetch
all the updates from a topic and construct a map with the latest value of each
key for the messages that were received. This is very common when constructing
a local cache of the data.
We want to offer support for this access pattern directly in the Pulsar client
API, as a way to encapsulate the complexities of setting this up.
Goal
Provide a view of the topic data in the form of a read-only map that is
constantly updated with the latest version of each key.
Additionally, let the application specify a listener so that it can perform
a scan of the map and then receive notifications when new messages are
received and applied.
API Changes
This proposal will only add new API on the client side.
A new type of consumer will be added, the
TableView
.Example:
When a
TableView
instance is created, it will be guaranteed to already havethe latest value for each key, for the current time.
API additions
Implementation
The
TableView
will be implemented using multipleReader
instances, oneper each partition and will always specify to read starting from the compacted
view of the topic.
The creation time of a table view can be controlled by configuring the
topic compaction policies for the given topic or namespace. More frequent
compaction can lead to very short startup times, as in less data will be
replayed to reconstruct the
TableView
of the topic.The text was updated successfully, but these errors were encountered: