Add a direct sub classes data structure to the Painless lookup#76955
Merged
Conversation
Collaborator
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
stu-elastic
reviewed
Aug 26, 2021
stu-elastic
approved these changes
Aug 26, 2021
stu-elastic
left a comment
Contributor
There was a problem hiding this comment.
Looks good, just a few comment requests.
Contributor
Author
|
@stu-elastic Thanks for the review. I addressed your comments, and I will commit once CI passes. |
Collaborator
💔 Backport failed
To backport manually run |
jdconrad
added a commit
to jdconrad/elasticsearch
that referenced
this pull request
Aug 26, 2021
…ic#76955) This change has two main components. The first is to have method/field resolution for compile-time and run-time use the same code path for now. This removes copying of member methods between super and sub classes and instead does a resolution through the class hierarchy. This allows us to correctly implement the next change. The second is a data structure that allows for the lookup of direct sub classes for all allow listed classes/interfaces within Painless.
jdconrad
added a commit
that referenced
this pull request
Dec 14, 2021
A recent change [1] to how we load our allow list changed the resolution for how Painless looks up methods of super classes. However, functional interface loading was not changed which caused a bug where a functional interface would not look at its super interfaces for the functional interface method [2]. This fixes the issue by going through each super interface until the functional interface method is found when the target interface doesn't have the functional interface method. [1] #76955 [2] #81696 Also a big thanks to @megglos and @TheFireCookie for their help with this issue.
jdconrad
added a commit
to jdconrad/elasticsearch
that referenced
this pull request
Dec 14, 2021
…1698) A recent change [1] to how we load our allow list changed the resolution for how Painless looks up methods of super classes. However, functional interface loading was not changed which caused a bug where a functional interface would not look at its super interfaces for the functional interface method [2]. This fixes the issue by going through each super interface until the functional interface method is found when the target interface doesn't have the functional interface method. [1] elastic#76955 [2] elastic#81696 Also a big thanks to @megglos and @TheFireCookie for their help with this issue.
jdconrad
added a commit
to jdconrad/elasticsearch
that referenced
this pull request
Dec 14, 2021
…1698) A recent change [1] to how we load our allow list changed the resolution for how Painless looks up methods of super classes. However, functional interface loading was not changed which caused a bug where a functional interface would not look at its super interfaces for the functional interface method [2]. This fixes the issue by going through each super interface until the functional interface method is found when the target interface doesn't have the functional interface method. [1] elastic#76955 [2] elastic#81696 Also a big thanks to @megglos and @TheFireCookie for their help with this issue.
jdconrad
added a commit
that referenced
this pull request
Dec 14, 2021
…81737) A recent change [1] to how we load our allow list changed the resolution for how Painless looks up methods of super classes. However, functional interface loading was not changed which caused a bug where a functional interface would not look at its super interfaces for the functional interface method [2]. This fixes the issue by going through each super interface until the functional interface method is found when the target interface doesn't have the functional interface method. [1] #76955 [2] #81696 Also a big thanks to @megglos and @TheFireCookie for their help with this issue.
jdconrad
added a commit
that referenced
this pull request
Dec 14, 2021
…81738) A recent change [1] to how we load our allow list changed the resolution for how Painless looks up methods of super classes. However, functional interface loading was not changed which caused a bug where a functional interface would not look at its super interfaces for the functional interface method [2]. This fixes the issue by going through each super interface until the functional interface method is found when the target interface doesn't have the functional interface method. [1] #76955 [2] #81696 Also a big thanks to @megglos and @TheFireCookie for their help with this issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change has two main components.
The first is to have method/field resolution for compile-time and run-time use the same code path for now. This removes copying of member methods between super and sub classes and instead does a resolution through the class hierarchy. This allows us to correctly implement the next change.
The second is a data structure that allows for the lookup of direct sub classes for all allow listed classes/interfaces within Painless.
Given there can be gaps within sub classes due to how allow listing is specified, a subclass may propagate to the nearest allow listed subclass.
Example:
In this case A has C as a direct sub class.
Example:
In this case A has C as a direct sub class.
Interfaces work the same way to propagate across any gaps in allow listing.