bube commented on code in PR #254:
URL: 
https://github.com/apache/flink-connector-aws/pull/254#discussion_r3861264915


##########
flink-connector-aws/flink-connector-aws-kinesis-streams/src/main/java/org/apache/flink/connector/kinesis/source/reader/KinesisShardSplitReaderBase.java:
##########
@@ -179,31 +183,48 @@ private boolean 
skipUntilScheduledFetchTime(KinesisShardSplitState splitState)
     }
 
     /**
-     * Schedules next fetch time, to be called immediately on the result of a 
fetchRecords() call.
+     * Defers the next fetch for the given split, if an interval is configured 
for it. To be called
+     * immediately after a fetchRecords() call.
      *
-     * <p>If recordBatch does not contain records, next fetchRecords() is 
scheduled. Before
-     * scheduled time, fetcher thread will skip fetching (and have small 
sleep) for the split.
+     * <p>If recordBatch is null or contains no records, the next fetch is 
deferred by
+     * emptyRecordsIntervalMillis. Until that time, the fetcher thread will 
skip fetching (and have a
+     * small sleep) for the split.
      *
-     * <p>If recordBatch is not empty, next fetchRecords() time is not 
scheduled resulting in next
-     * fetch on the split is performed at first opportunity.
+     * <p>If recordBatch is not empty, the next fetch is deferred by 
nonEmptyRecordsIntervalMillis.
+     * When that interval is zero (the default), nothing is deferred and the 
next fetch on the split
+     * is performed at the first opportunity.
      *
-     * @param splitState splitState on which the fetchRecords() was called on
-     * @param recordBatch recordBatch returned by fetchRecords()
+     * @param splitState split state the fetchRecords() call was made for
+     * @param recordBatch record batch returned by fetchRecords()
      */
-    private void scheduleNextFetchTime(KinesisShardSplitState splitState, 
RecordBatch recordBatch) {
+    private void maybeDeferNextFetch(KinesisShardSplitState splitState, 
RecordBatch recordBatch) {

Review Comment:
   I like it. Improves the readability. Done



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