You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "tomstepp (via GitHub)" <gi...@apache.org> on 2025/01/17 00:58:02 UTC

Re: [PR] Add offset-based deduplication to Unbounded Source and Dataflow Runner. [beam]

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.
   
   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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org