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 17854200CDD for ; Mon, 7 Aug 2017 18:10:40 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 15FE2165963; Mon, 7 Aug 2017 16:10:40 +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 5D178165965 for ; Mon, 7 Aug 2017 18:10:39 +0200 (CEST) Received: (qmail 76697 invoked by uid 500); 7 Aug 2017 16:10:38 -0000 Mailing-List: contact commits-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list commits@flink.apache.org Received: (qmail 76688 invoked by uid 99); 7 Aug 2017 16:10:38 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Aug 2017 16:10:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AD305DFB94; Mon, 7 Aug 2017 16:10:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: fhueske@apache.org To: commits@flink.apache.org Date: Mon, 07 Aug 2017 16:10:38 -0000 Message-Id: <1a0abb10534449a39c7332b8bb131dc2@git.apache.org> In-Reply-To: <39e10a64968e4770b9ef8652dab546ef@git.apache.org> References: <39e10a64968e4770b9ef8652dab546ef@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] flink git commit: [FLINK-7298] [table] Improve state clean-up of proctime window join. archived-at: Mon, 07 Aug 2017 16:10:40 -0000 [FLINK-7298] [table] Improve state clean-up of proctime window join. This closes #4421. Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/8c9642f7 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/8c9642f7 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/8c9642f7 Branch: refs/heads/master Commit: 8c9642f7d8c67251c6d59bba3a02661d8f537331 Parents: 6ea9dbb Author: 军长 Authored: Mon Jul 31 11:14:06 2017 +0800 Committer: Fabian Hueske Committed: Mon Aug 7 16:24:28 2017 +0200 ---------------------------------------------------------------------- .../runtime/join/ProcTimeWindowInnerJoin.scala | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/8c9642f7/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/join/ProcTimeWindowInnerJoin.scala ---------------------------------------------------------------------- diff --git a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/join/ProcTimeWindowInnerJoin.scala b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/join/ProcTimeWindowInnerJoin.scala index 8a3ba43..e62a18f 100644 --- a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/join/ProcTimeWindowInnerJoin.scala +++ b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/join/ProcTimeWindowInnerJoin.scala @@ -324,17 +324,18 @@ class ProcTimeWindowInnerJoin( } } - // Remove expired records from state - var i = removeList.size - 1 - while (i >= 0) { - rowMapState.remove(removeList.get(i)) - i -= 1 - } - removeList.clear() - // If the state has non-expired timestamps, register a new timer. // Otherwise clean the complete state for this input. if (validTimestamp) { + + // Remove expired records from state + var i = removeList.size - 1 + while (i >= 0) { + rowMapState.remove(removeList.get(i)) + i -= 1 + } + removeList.clear() + val cleanupTime = curTime + winSize + 1 ctx.timerService.registerProcessingTimeTimer(cleanupTime) timerState.update(cleanupTime)