You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/05/07 19:26:33 UTC

[GitHub] [beam] sgraca commented on a change in pull request #11377: [BEAM-9439] Return split instead of total backlog size

sgraca commented on a change in pull request #11377:
URL: https://github.com/apache/beam/pull/11377#discussion_r421740373



##########
File path: sdks/java/io/kinesis/src/main/java/org/apache/beam/sdk/io/kinesis/ShardRecordsIterator.java
##########
@@ -43,22 +42,23 @@
   private final RecordFilter filter;
   private final String streamName;
   private final String shardId;
-  private AtomicReference<ShardCheckpoint> checkpoint;
+  private final AtomicReference<ShardCheckpoint> checkpoint;
+  private final WatermarkPolicy watermarkPolicy;

Review comment:
       I don't know why it was used in the first place, maybe it was some leftover after some previous changes to the code. The value of `watermarkPolicy` is only set in constructor and then only accessed (never changed), so there's no need to have an `AtomicReference` for that. From the perspective of memory visiblity, making the field as `final` ensures that the value of the field is correctly published to other threads, so there's no difference also in that aspect.




----------------------------------------------------------------
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.

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