azagrebin commented on a change in pull request #6438: [FLINK-9981] Tune performance of RocksDB implementation URL: https://github.com/apache/flink/pull/6438#discussion_r206523056
########## File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/InternalTimerServiceImpl.java ########## @@ -227,37 +227,31 @@ public void onProcessingTime(long time) throws Exception { // inside the callback. nextTimer = null; - processingTimeTimersQueue.bulkPoll( - (timer) -> (timer.getTimestamp() <= time), - (timer) -> { - keyContext.setCurrentKey(timer.getKey()); - try { - triggerTarget.onProcessingTime(timer); - } catch (Exception e) { - throw new FlinkRuntimeException("Problem in trigger target.", e); - } - }); + InternalTimer<K, N> timer; + + while ((timer = processingTimeTimersQueue.peek()) != null && timer.getTimestamp() <= time) { + processingTimeTimersQueue.poll(); + keyContext.setCurrentKey(timer.getKey()); + triggerTarget.onProcessingTime(timer); + } - if (nextTimer == null) { - final TimerHeapInternalTimer<K, N> timer = processingTimeTimersQueue.peek(); - if (timer != null) { + if (timer != null) { + if (nextTimer == null) { Review comment: if (timer != null && nextTimer == null) { ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services