tomstepp commented on code in PR #33591:
URL: https://github.com/apache/beam/pull/33591#discussion_r1919418801
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingModeExecutionContext.java:
##########
@@ -194,6 +194,13 @@ public boolean workIsFailed() {
return Optional.ofNullable(work).map(Work::isFailed).orElse(false);
}
+ public byte[] getCurrentRecordOffset() {
+ if (activeReader == null) {
+ return new byte[0];
Review Comment:
I used the static singleton for now. Perhaps we can continue with it based
on notes below.
I previously tried annotating as nullable but received errors that it is not
compatible with primitive types like byte. Without nullable annotation,
returning null is also marked as an error. I have not done a lot of Beam Java
coding, so I possibly misunderstood something.
However, I think empty bytes can/should be considered invalid, so it's okay
to use empty as invalid rather than both empty and null. Wdyt?
--
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]