diegomez17 commented on code in PR #16939:
URL: https://github.com/apache/beam/pull/16939#discussion_r866889010


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java:
##########
@@ -210,6 +231,255 @@ public Row getCurrentRow() throws NoSuchElementException {
     }
   }
 
+  @VisibleForTesting
+  static class BigtableSegmentReaderImpl implements Reader {
+    private BigtableSession session;
+    private final BigtableSource source;
+    private Row currentRow;
+    private Queue<FlatRow> buffer;
+    private RowSet rowSet;
+    private ServiceCallMetric serviceCallMetric;
+    private Future<ImmutablePair<List<FlatRow>, Boolean>> future;
+    private ByteString lastFetchedRow;
+    private boolean lastFillComplete;
+    private boolean byteLimitReached;
+
+    private final int segmentLimit;
+    private final int segmentWaterMark;
+    private final String tableName;
+
+    @VisibleForTesting
+    BigtableSegmentReaderImpl(BigtableSession session, BigtableSource source) {
+      this.session = session;
+      if (source.getMaxBufferElementCount() != null && 
source.getMaxBufferElementCount() != 0) {
+        this.segmentLimit = source.getMaxBufferElementCount();
+      } else {
+        this.segmentLimit = DEFAULT_SEGMENT_SIZE;
+      }
+      // Asynchronously refill buffer when there is 10% of the elements are 
left
+      this.segmentWaterMark = segmentLimit / 10;

Review Comment:
   refillSegmentWatermark? I don't like that the variable doesn't refer to what 
watermark is for



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

Reply via email to