-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Allow project reserved state handlers to update any cluster state #128636
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
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
| * is {@link LocalStateAutoscaling}, therefore we need to provide a test version of this class. | ||
| */ | ||
| public class LocalStateReservedAutoscalingStateHandlerProvider implements ReservedClusterStateHandlerProvider { | ||
| public class LocalStateReservedAutoscalingStateHandlerProvider implements ReservedStateHandlerProvider { |
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.
Is this class used?
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.
Implementations of ReservedStateHandlerProvider are loaded via SPI so there's no direct references to the class other than where the provider is registered in META-INF/services or module-info.java.
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.
Also, this particular handler seems to be used only for mocking autoscaling events in tests.
rjernst
left a comment
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 just skimmed the interface changes, they look good. The rest seems to just be fallout from the name/type changes.
This refactors our reserved state infrastructure related to project-level reserved state handlers. The initial implementation of project state handlers worked on
ProjectMetadataon the assumption that all per-project state will live there, however, this is not always the case. We may want to keep some per-project data directly onClusterState, specifically per-project configuration that may be sourced from file-based configuration that we don't want to persist inProjectMetadata. This change includes the following:ReservedClusterStateHandlerhas been reverted to remove the additionalSgeneric type parameter. This type was technically unbounded but in practice could only be one ofClusterStateorProjectMetadata. To simplify things this has been removed and all state handlers (cluster or project level) transform aClusterState.ReservedProjectStateHandlerhas been introduced whosetransform()method accepts aProjectIdin addition to the state object.ReservedClusterStateHandlerimplementations that work at the project level have been converted toReservedProjectStateHandlerthus removing a number of usages of the deprecatedMetadata.getProject()method.