-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Fix][Flink] Resolve streaming source high CPU usage #8354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| private final ScheduledExecutorService scheduledExecutor = | ||
| Executors.newSingleThreadScheduledExecutor( | ||
| r -> { | ||
| Thread thread = new Thread(r, "source-reader-scheduler"); | ||
| thread.setDaemon(true); | ||
| return thread; | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you share some details about why we should introduce the ScheduledExecutorService in reader?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When there is no data, we should return InputStatus.NOTHIND_AVAILABLE When returning the NOTHIND_AVAILABLE state, the isAvailable() method will be executed. IsAvailable returns a future, where the longer the blocking time, the lower the Busy value.
Carl-Zhou-CN
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
...nk-common/src/main/java/org/apache/seatunnel/translation/flink/source/FlinkSourceReader.java
Outdated
Show resolved
Hide resolved
hailin0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
TyrantLucifer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, could you please offer some test results about this optimize?
...nk-common/src/main/java/org/apache/seatunnel/translation/flink/source/FlinkSourceReader.java
Outdated
Show resolved
Hide resolved
eae9995
Purpose of this pull request
modify after
Verify Source Kafka
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide
release-note.