-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-10199: Change to RUNNING if no pending task to recycle exist #14145
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,6 +114,11 @@ public void addPendingTaskToRecycle(final TaskId taskId, final Set<TopicPartitio | |
| pendingUpdateActions.put(taskId, PendingUpdateAction.createRecycleTask(inputPartitions)); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean pendingTasksToRecycleExist() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. super nit: This name sounds like its should return a list of tasks that are pending to recycle. Maybe add an
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would call is
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea! |
||
| return pendingUpdateActions.values().stream().anyMatch(action -> action.getAction() == Action.RECYCLE); | ||
| } | ||
|
|
||
| @Override | ||
| public Set<TopicPartition> removePendingTaskToUpdateInputPartitions(final TaskId taskId) { | ||
| if (containsTaskIdWithAction(taskId, Action.UPDATE_INPUT_PARTITIONS)) { | ||
|
|
||
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.
I am not familiar with this code. The method name is
checkStateUpdater-- but check for what? Semantics are not clear to me. Could we find a better name or add a comment?Uh oh!
There was an error while loading. Please reload this page.
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.
I will consider to rename this method in a different PR since I am thinking about to split this method in three methods -- one for adding tasks to the state updater, one for getting tasks from the state updater, and one for checking whether the stream thread can change state to RUNNING.
That should make the code clearer and also testing might become simpler.