Skip to content

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

Merged
merged 1 commit into from
Dec 17, 2015
Merged

Add callback for publication of new cluster state #15494

merged 1 commit into from
Dec 17, 2015

Conversation

jasontedor
Copy link
Member

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

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) {
Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Contributor

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.

@bleskes
Copy link
Contributor

bleskes commented Dec 17, 2015

Left one comment. Do we also want to immediately use it for the shard state action?

@jasontedor
Copy link
Member Author

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.

@bleskes
Copy link
Contributor

bleskes commented Dec 17, 2015

LGTM

@jasontedor jasontedor removed the review label Dec 17, 2015
jasontedor added a commit that referenced this pull request Dec 17, 2015
…lback

Add callback for publication of new cluster state
@jasontedor jasontedor merged commit 1bc196c into elastic:master Dec 17, 2015
@jasontedor jasontedor deleted the cluster-state-published-callback branch December 17, 2015 13:31
jasontedor added a commit that referenced this pull request Dec 17, 2015
This commit backports commit 1bc196c
from master to 2.x.

Relates #15494
@clintongormley clintongormley added :Distributed Indexing/Distributed A catch all label for anything in the Distributed Indexing Area. Please avoid if you can. and removed :Cluster labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Distributed A catch all label for anything in the Distributed Indexing Area. Please avoid if you can. >enhancement v2.2.0 v5.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants