scwhittle commented on code in PR #38842:
URL: https://github.com/apache/beam/pull/38842#discussion_r3371751361
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingModeExecutionContext.java:
##########
@@ -950,12 +962,14 @@ private boolean isTimerUnmodified(TimerData timerData) {
return updatedTimer == null || updatedTimer.equals(timerData);
}
- public <W extends BoundedWindow> TimerData getNextFiredUserTimer(Coder<W>
windowCoder) {
- if (cachedFiredUserTimers == null) {
+ public <W extends BoundedWindow> @Nullable TimerData getNextFiredUserTimer(
+ Coder<W> windowCoder) {
+ PeekingIterator<TimerData> firedUserTimers = cachedFiredUserTimers;
Review Comment:
ditto
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingModeExecutionContext.java:
##########
@@ -893,9 +903,10 @@ public void setBacklogBytes(double backlogBytes) {
}
@Override
- public <W extends BoundedWindow> TimerData getNextFiredTimer(Coder<W>
windowCoder) {
- if (cachedFiredSystemTimers == null) {
- cachedFiredSystemTimers =
+ public <W extends BoundedWindow> @Nullable TimerData
getNextFiredTimer(Coder<W> windowCoder) {
+ Iterator<TimerData> firedSystemTimers = cachedFiredSystemTimers;
Review Comment:
do it? seems like will reduce allocations in common case, even if null
exception isn't a concern
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingModeExecutionContext.java:
##########
Review Comment:
rm todo
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]