Github user greghogan commented on a diff in the pull request:
https://github.com/apache/flink/pull/2568#discussion_r81200110
--- Diff:
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<StreamRecord<IN>>(numberPriorityQueueEntries, new
StreamRecordComparator<IN>());
-
- for (int i = 0; i <numberPriorityQueueEntries; i++) {
- StreamElement streamElement =
streamRecordSerializer.deserialize(new DataInputViewStreamWrapper(ois));
- priorityQueue.offer(streamElement.<IN>asRecord());
+ if(numberPriorityQueueEntries > 0) {
+ priorityQueue = new
PriorityQueue<StreamRecord<IN>>(numberPriorityQueueEntries, new
StreamRecordComparator<IN>());
--- End diff --
The queue is created in `open()`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---