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


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java:
##########
@@ -271,32 +265,24 @@ static BigtableSegmentReaderImpl create(BigtableSession 
session, BigtableSource
               .setFilter(filter)
               .setRowsLimit(source.getMaxBufferElementCount())
               .build();
-      return new BigtableSegmentReaderImpl(
-          session, request, source.getTableId().get(), filter, 
source.getMaxBufferElementCount());
+
+      serviceCallMetric = populateReaderCallMetric(session, 
source.getTableId().get());
+
+      long maxSegmentByteSize =
+          (long)(Runtime.getRuntime().totalMemory()
+              * DEFAULT_BYTE_LIMIT_PERCENTAGE);
+
+      return new BigtableSegmentReaderImpl(session, request, 
maxSegmentByteSize);
     }
 
     @VisibleForTesting
-    BigtableSegmentReaderImpl(
-        BigtableSession session,
-        ReadRowsRequest request,
-        String tableId,
-        RowFilter filter,
-        int segmentSize) {
+    BigtableSegmentReaderImpl(BigtableSession session, ReadRowsRequest 
request, long maxSegmentByteSize) {

Review Comment:
   Igor wanted to avoid using source when we don't have to. I'm okay either 
way, @igorbernstein2 thoughts?



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