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

ASF GitHub Bot commented on KAFKA-4468:
---------------------------------------

GitHub user ConcurrencyPractitioner opened a pull request:

    https://github.com/apache/kafka/pull/3745

    [KAFKA-4468] Correctly calculate the window end timestamp after read from 
state stores

    I have decided to use the following approach to fixing this bug:
    
    1) Since the Window Size in WindowedDeserializer was originally unknown, I 
have initialized
    a field _windowSize_ and created a constructor to allow it to be 
instantiated
    
    2) The default size for __windowSize__ is _Long.MAX_VALUE_. If that is the 
case, then the 
    deserialize method will return an Unlimited Window, or else will return 
Timed one.
    
    3) Temperature Demo was modified to demonstrate how to use this new 
constructor, given
    that the window size is known.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ConcurrencyPractitioner/kafka trunk

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/3745.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3745
    
----
commit 7dcf42e110dadd3f257c7ea1a0d10adc60bd0eea
Author: Richard Yu <richar...@richards-air.attlocal.net>
Date:   2017-08-26T20:18:48Z

    KAFKA-4468 Correctly calculate the window end timestamp after read from 
state stores

----


> 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