arunpandianp commented on code in PR #32566:
URL: https://github.com/apache/beam/pull/32566#discussion_r1776091898
##########
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:
I would just leave it as `work.getWorkItem`, NullpointerException is
clearer than IllegalArgumentException
--
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]