Skip to content

Update the signature of the submitStateUpdateTask across the codebase. #82942

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

Merged
merged 6 commits into from
Jan 25, 2022

Conversation

idegtiarenko
Copy link
Contributor

@idegtiarenko idegtiarenko commented Jan 24, 2022

This change updates submitStateUpdateTask signature to enforce task implements
ClusterStateTaskListener and remove extra listener argument. This reduces the
number of arguments and simplifies the call sites as all tasks are listeners already.

Related to: #82644

Today node removal tasks executed by the master have a separate
ClusterStateTaskListener to feed back the result to the requester.
It'd be preferable to use the task itself as the listener.
@idegtiarenko idegtiarenko added >refactoring :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.1.0 labels Jan 24, 2022
@DaveCTurner
Copy link
Contributor

A good step but not quite enough to complete #82644 I think, the last item is to change public interface ClusterStateTaskExecutor<T> to public interface ClusterStateTaskExecutor<T extends ClusterStateTaskListener> (and deal with any remaining consequences). That can be a follow-up of course.

Would also be nice if submitStateUpdateTasks took a List<T> rather than a Map<T, ClusterStateTaskListener> here.

@idegtiarenko idegtiarenko marked this pull request as ready for review January 25, 2022 09:26
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for the closes #82644 from the commit body (and the rest of the commit message looks to be copied from elsewhere too)

@idegtiarenko
Copy link
Contributor Author

@elasticmachine please run elasticsearch-ci/part-1

@idegtiarenko idegtiarenko merged commit 65d27ad into elastic:master Jan 25, 2022
@idegtiarenko idegtiarenko deleted the 82644_update_interface branch January 25, 2022 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. >refactoring Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants