Global Store Adding change log topic
saggarsunil opened this issue · 7 comments
I have a situation where i want to maintain my own global table structure. Essentially, Global Store is linked to a processor and i use some calculations to create key and then store it to key-value store.
Since global state store doesn’t have change log topic, it uses original topic as change log. And in case of state restore, it just loads the topic data to global table (which will be wrong) since we constructed our own key & value.
Topic Data
Key, value
1234,abcd
4567,defg
StateStore
Key, value
12ab, abcd
45de, defg
My requirement is to create a global store with my custom keys ( not the one which comes directly from topic). Any solution ?
What you want to do is not supported. A global store is a read-only materialized view of the data from the corresponding input topic. The only way to "write" into the store is by writing into the topic.
Does writing into the topic (instead of directly into the store) work for you?
We are able to write to global state store. So, it is not read only. Also, does that mean any updates to the records will not be processed ?
It's a flaw in the API. You can "write" but you need to write the data from the source topic unmodified. Hence, you cannot write anything "arbitrary" or anything based on some computation. The data in the store must be the exact some data as in the input topic atm.
To remove this limitation we need to address those two tickets:
Can you elaborate how you do this? Curious to learn about it.
I see -- you don't really create a changelog topic, but follow my suggestion from above:
Does writing into the topic (instead of directly into the store) work for you?
Maybe this statement was too brief to be clear....