diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/LargeReadRowsResumptionStrategy.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/LargeReadRowsResumptionStrategy.java index 93b6b548ddcd..4639582a8fb7 100644 --- a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/LargeReadRowsResumptionStrategy.java +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/LargeReadRowsResumptionStrategy.java @@ -50,7 +50,7 @@ public class LargeReadRowsResumptionStrategy Logger.getLogger(LargeReadRowsResumptionStrategy.class.getName()); private final RowAdapter rowAdapter; private ByteString lastSuccessKey = ByteString.EMPTY; - // Number of rows processed excluding Marker row. + // Number of rows processed (including skipped large rows, excluding marker rows). private long numProcessed; private ByteString largeRowKey = ByteString.EMPTY; // we modify the original request in the resumption strategy regardless of how many times it has @@ -93,6 +93,8 @@ public Throwable processError(Throwable throwable) { if (rowKeyExtracted != null) { LOGGER.warning("skipping large row " + rowKeyExtracted); this.largeRowKey = rowKeyExtracted; + // Skipped large rows would have been returned if not for system size limits, so they + // intentionally count towards the query's row limit. numProcessed = numProcessed + 1; } return throwable; @@ -116,7 +118,7 @@ private ByteString extractLargeRowKey(Throwable t) { *

This returns an updated request excluding all the rows keys & ranges till (including) {@link * #lastSuccessKey} & also excludes the last encountered large row key ({@link #largeRowKey}). * Also, this implementation takes care to update the row limit of the request to account for all - * of the received rows. + * of the received rows and skipped large rows. */ @Override public ReadRowsRequest getResumeRequest(ReadRowsRequest originalRequest) {