Skip to content
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

More useful toString on UpdateSettingsTask #93514

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import org.elasticsearch.cluster.ack.IndicesClusterStateUpdateRequest;
import org.elasticsearch.common.settings.Settings;

import java.util.Arrays;

/**
* Cluster state update request that allows to update settings for some indices
*/
Expand Down Expand Up @@ -51,4 +53,9 @@ public UpdateSettingsClusterStateUpdateRequest settings(Settings settings) {
this.settings = settings;
return this;
}

@Override
public String toString() {
return Arrays.toString(indices()) + settings;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it mention anywhere that this is UpdateSettingsClusterStateUpdateRequest?
I wonder if it might not be immediately obvious what produced the string in case we have many strings from distinct cluster state update tasks.

Copy link
Contributor Author

@DaveCTurner DaveCTurner Feb 6, 2023

Choose a reason for hiding this comment

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

We also include the source of the tasks (which is entry.getKey() here:

return tasks.isEmpty() ? entry.getKey() : entry.getKey() + "[" + tasks + "]";

For the update-settings tasks this includes the string update-settings so I think there is no chance of confusion here.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ ClusterState execute(ClusterState currentState) {

return updatedState;
}

@Override
public String toString() {
return request.toString();
}
}

public void updateSettings(final UpdateSettingsClusterStateUpdateRequest request, final ActionListener<AcknowledgedResponse> listener) {
Expand Down