-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add callback for publication of new cluster state #15494
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
Add callback for publication of new cluster state #15494
Conversation
This commit adds a callback for a cluster state task executor that will be invoked if the execution of a batch of cluster state update tasks led to a new cluster state and that new cluster state was successfully published. Closes #15482
* Callback invoked after new cluster state is published. Note that | ||
* this method is not invoked if the cluster state was not updated. | ||
*/ | ||
default void clusterStatePublished(ClusterState newClusterState) { |
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'm doubtful. I wonder if we should do this or follow the proven path we have in the listener interface where we have a processed callback (changed or not). I'm leaning towards the later as it gives more options (with the burden of an extra equality check).
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.
@bleskes I went back and forth, but opted for this simpler interface since for now the use case we have in mind doesn't need the callback on no change.
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.
ok. I'm with you.
Left one comment. Do we also want to immediately use it for the shard state action? |
@bleskes Yes. I've a commit sitting locally pending the outcome of this pull request which I'll push to another pull request. |
LGTM |
…lback Add callback for publication of new cluster state
This commit adds a callback for a cluster state task executor that will
be invoked if the execution of a batch of cluster state update tasks
led to a new cluster state and that new cluster state was successfully
published.
Closes #15482