From issues-return-182942-archive-asf-public=cust-asf.ponee.io@flink.apache.org Tue Aug 7 11:40:49 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4D186180676 for ; Tue, 7 Aug 2018 11:40:49 +0200 (CEST) Received: (qmail 42180 invoked by uid 500); 7 Aug 2018 09:40:48 -0000 Mailing-List: contact issues-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 issues@flink.apache.org Received: (qmail 42171 invoked by uid 99); 7 Aug 2018 09:40:48 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2018 09:40:48 +0000 From: GitBox To: issues@flink.apache.org Subject: [GitHub] dawidwys closed pull request #2568: [FLINK-4636] Add boundary check for priorityqueue for cep operator Message-ID: <153363484787.17735.2923589830088212768.gitbox@gitbox.apache.org> Date: Tue, 07 Aug 2018 09:40:47 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit dawidwys closed pull request #2568: [FLINK-4636] Add boundary check for priorityqueue for cep operator URL: https://github.com/apache/flink/pull/2568 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/AbstractCEPPatternOperator.java b/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/AbstractCEPPatternOperator.java index 64ffa2a0d1c..b428ba62d2d 100644 --- a/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/AbstractCEPPatternOperator.java +++ b/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/AbstractCEPPatternOperator.java @@ -126,11 +126,12 @@ public void restoreState(FSDataInputStream state) throws Exception { int numberPriorityQueueEntries = ois.readInt(); - priorityQueue = new PriorityQueue>(numberPriorityQueueEntries, new StreamRecordComparator()); - - for (int i = 0; i asRecord()); + if(numberPriorityQueueEntries > 0) { + priorityQueue = new PriorityQueue>(numberPriorityQueueEntries, new StreamRecordComparator()); + for (int i = 0; i asRecord()); + } } } } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services