Global state store during restoration will dump the data from the source topic(Which is consider as change-log topic for global-store).
for delete a record i do something like below
kvStore.put("key-1",null)
how Kafka know's that the record is delete and during restoration it will dump record from source topic (consider source topic has a record with key-1)
In my topology I have
- an input topic -> T1
- and a process is attached that read data from T1 and construct a key from the record and forward down to topic T2
- and topic T2 is a source topic for global state store.
Example:
- T1 i got data:
{"id":'123', "name":"Mohit", "type":"insert"}
- construct a key for record and forward Down to topic with key and value as T2 -> key:
123
and value:{"id":'123', "name":"Mohit"}
After that same key record come as type delete in data.
T1 got data: {"id":'123', "name":"Mohit", "type":"insert"}
so i am forward record as like this
this.context.forward(key, null)
key: 123 value:null
Same is updated in state-store
I just want to know that during restoration with this record will be delete means i get null if i go get on store with key 123
.