m-trieu commented on code in PR #32566:
URL: https://github.com/apache/beam/pull/32566#discussion_r1776096965
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingModeExecutionContext.java:
##########
@@ -329,27 +328,27 @@ private <T> SideInput<T> fetchSideInputFromWindmill(
}
public Iterable<Windmill.GlobalDataId> getSideInputNotifications() {
- return work.getWorkItem().getGlobalDataIdNotificationsList();
+ return getWorkItem().getGlobalDataIdNotificationsList();
}
private List<Timer> getFiredTimers() {
- return work.getWorkItem().getTimers().getTimersList();
+ return getWorkItem().getTimers().getTimersList();
}
public @Nullable ByteString getSerializedKey() {
- return work.getWorkItem().getKey();
+ return work == null ? null : work.getWorkItem().getKey();
}
public WindmillComputationKey getComputationKey() {
return computationKey;
}
public long getWorkToken() {
- return work.getWorkItem().getWorkToken();
+ return getWorkItem().getWorkToken();
}
public Windmill.WorkItem getWorkItem() {
- return work.getWorkItem();
+ return checkNotNull(work).getWorkItem();
Review Comment:
checker will complain since we mark `work` field as `Nullable` now
this will still throw an NPE with the `checkNotNull` check
i added a more clear error message.
--
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]