leekeiabstraction commented on code in PR #195:
URL:
https://github.com/apache/flink-connector-aws/pull/195#discussion_r2044066113
##########
flink-connector-aws/flink-connector-aws-kinesis-streams/src/main/java/org/apache/flink/connector/kinesis/source/reader/KinesisShardSplitReaderBase.java:
##########
@@ -125,6 +144,52 @@ public RecordsWithSplitIds<Record> fetch() throws
IOException {
recordBatch.isCompleted());
}
+ private boolean skipWhenNoAssignedSplit(KinesisShardSplitState splitState)
throws IOException {
+ if (splitState == null) {
+ try {
+ // Small sleep to prevent busy polling
+ Thread.sleep(1);
+ return true;
+ } catch (InterruptedException e) {
+ throw new IOException("Sleep was interrupted while skipping no
assigned split", e);
+ }
+ }
+
+ return false;
+ }
+
+ private boolean skipUntilScheduledFetchTime(KinesisShardSplitState
splitState)
+ throws IOException {
+ if (scheduledFetchTimes.containsKey(splitState)
+ && scheduledFetchTimes.get(splitState) >
System.currentTimeMillis()) {
+ try {
+ // Small sleep to prevent busy polling
+ Thread.sleep(1);
+ return true;
+ } catch (InterruptedException e) {
+ throw new IOException(
Review Comment:
Nice catch! Added Thread.currentThread().interrupt() in latest commits.
--
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]