leonardBang commented on code in PR #27134:
URL: https://github.com/apache/flink/pull/27134#discussion_r2472060052


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/reader/SourceReaderBase.java:
##########
@@ -156,14 +177,29 @@ public InputStatus pollNext(ReaderOutput<T> output) 
throws Exception {
 
         // we need to loop here, because we may have to go across splits
         while (true) {
+            // Check if the previous record count reached the limit of 
rateLimiter.
+            if (rateLimitPermissionFuture != null && 
!rateLimitPermissionFuture.isDone()) {

Review Comment:
   In current implementation, we need to check here for **each record** even 
rateLimitPermissionFuture is null , I believe this will introduce a performance 
regression. We can avoid this regression as we've known that 
`rateLimiterStrategy` nullability in constructor. 



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