[ 
https://issues.apache.org/jira/browse/KAFKA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16068935#comment-16068935
 ] 

Matthias J. Sax commented on KAFKA-4468:
----------------------------------------

[~evis] In 
{{org.apache.kafka.streams.kstream.internals.WindowedDeserializer#deserialize}} 
we instantiate an {{UnlimitedWindow}} as return object. However, we should 
instantiate a {{TimeWindow}} (or {{SessionWindow}}?). For this, we need to get 
the window end time stamp. We (you :)) need to figure out, how we can get the 
time window size (and window type?) into the deserializer to allow us to 
compute the window end timestamp (base on start and size) to return the correct 
window. Thinking about this, we might even need different (de)serializers for 
different window types. Out of my head, I am not sure how we handle/encode 
{{SessionWindows}} (\cc [~damianguy]). I am also wondering, how we should 
handle different window types (ie, {{TimeWindow}} vs {{UnlimetedWIndow}}).

> Correctly calculate the window end timestamp after read from state stores
> -------------------------------------------------------------------------
>
>                 Key: KAFKA-4468
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4468
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>            Reporter: Guozhang Wang
>              Labels: architecture
>
> When storing the WindowedStore on the persistent KV store, we only use the 
> start timestamp of the window as part of the combo-key as (start-timestamp, 
> key). The reason that we do not add the end-timestamp as well is that we can 
> always calculate it from the start timestamp + window_length, and hence we 
> can save 8 bytes per key on the persistent KV store.
> However, after read it (via {{WindowedDeserializer}}) we do not set its end 
> timestamp correctly but just read it as an {{UnlimitedWindow}}. We should fix 
> this by calculating its end timestamp as mentioned above.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to