@@ -271,23 +271,22 @@ private StreamingOffset calculateEndOffset(StreamingOffset start) {
271
271
}
272
272
273
273
/**
274
- * Streaming Read control is performed by changing the startOffset and maxSize.
274
+ * Streaming Read control is performed by changing the offset and maxSize.
275
275
*
276
- * @param startOffset The start offset to scan from
276
+ * @param offset The start offset to scan from
277
277
* @param maxSize The maximum size of Bytes can calculate how many batches
278
278
* @return MicroBatch of list
279
279
*/
280
280
@ VisibleForTesting
281
- @ SuppressWarnings ("checkstyle:HiddenField" )
282
- List <MicroBatch > getChangesWithRateLimit (StreamingOffset startOffset , long maxSize ) {
281
+ List <MicroBatch > getChangesWithRateLimit (StreamingOffset offset , long maxSize ) {
283
282
List <MicroBatch > batches = Lists .newArrayList ();
284
283
long currentLeftSize = maxSize ;
285
284
MicroBatch lastBatch = null ;
286
285
287
- assertNoOverwrite (table .snapshot (startOffset .snapshotId ()));
288
- if (shouldGenerateFromStartOffset (startOffset )) {
289
- MicroBatch batch = generateMicroBatch (startOffset .snapshotId (), startOffset .position (),
290
- startOffset .shouldScanAllFiles (), currentLeftSize );
286
+ assertNoOverwrite (table .snapshot (offset .snapshotId ()));
287
+ if (shouldGenerateFromStartOffset (offset )) {
288
+ MicroBatch batch = generateMicroBatch (offset .snapshotId (), offset .position (),
289
+ offset .shouldScanAllFiles (), currentLeftSize );
291
290
if (!batch .tasks ().isEmpty ()) {
292
291
batches .add (batch );
293
292
currentLeftSize -= batch .sizeInBytes ();
@@ -301,13 +300,13 @@ List<MicroBatch> getChangesWithRateLimit(StreamingOffset startOffset, long maxSi
301
300
}
302
301
303
302
long currentSnapshotId = table .currentSnapshot ().snapshotId ();
304
- if (currentSnapshotId == startOffset .snapshotId ()) {
303
+ if (currentSnapshotId == offset .snapshotId ()) {
305
304
// the snapshot of current offset is already the latest snapshot of this table.
306
305
return batches ;
307
306
}
308
307
309
308
ImmutableList <Long > snapshotIds = ImmutableList .<Long >builder ()
310
- .addAll (SnapshotUtil .snapshotIdsBetween (table , startOffset .snapshotId (), currentSnapshotId ))
309
+ .addAll (SnapshotUtil .snapshotIdsBetween (table , offset .snapshotId (), currentSnapshotId ))
311
310
.build ()
312
311
.reverse ();
313
312
0 commit comments