Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AE15A200CBD for ; Thu, 6 Jul 2017 12:04:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id ACB4F165F47; Thu, 6 Jul 2017 10:04:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0057E165F43 for ; Thu, 6 Jul 2017 12:04:03 +0200 (CEST) Received: (qmail 46161 invoked by uid 500); 6 Jul 2017 10:04:03 -0000 Mailing-List: contact jira-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@kafka.apache.org Delivered-To: mailing list jira@kafka.apache.org Received: (qmail 46149 invoked by uid 99); 6 Jul 2017 10:04:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jul 2017 10:04:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A408BC05A7 for ; Thu, 6 Jul 2017 10:04:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id wib2IrzetmPd for ; Thu, 6 Jul 2017 10:04:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 2121F5FB40 for ; Thu, 6 Jul 2017 10:04:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 68A0CE0641 for ; Thu, 6 Jul 2017 10:04:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 212A32462A for ; Thu, 6 Jul 2017 10:04:00 +0000 (UTC) Date: Thu, 6 Jul 2017 10:04:00 +0000 (UTC) From: "Evgeny Veretennikov (JIRA)" To: jira@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KAFKA-4468) Correctly calculate the window end timestamp after read from state stores MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 06 Jul 2017 10:04:04 -0000 [ https://issues.apache.org/jira/browse/KAFKA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16076281#comment-16076281 ] Evgeny Veretennikov commented on KAFKA-4468: -------------------------------------------- I have researched windowed stores a bit more and noticed, that {{WindowedDeserializer}} isn't used in Kafka source codes, including internals: {noformat} $ grep -Rl WindowedDeserializer | grep java | grep -v test streams/src/main/java/org/apache/kafka/streams/kstream/internals/WindowedDeserializer.java {noformat} It's not a part of API too (as it's in {{internals}} package). {{RocksDBWindowStore}} doesn't use {{WindowedDeserializer}} to deserialize windowed keys, but uses {{WindowStoreUtils}} static methods instead, including {{timeWindowForSize()}} method, which already uses {{windowSize}} to calculate proper {{TimeWindow}}. So, shouldn't we just remove {{WindowedDeserializer}}? > 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)