-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Remove direct dependency between ParserContext and MapperService #63741
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
Remove direct dependency between ParserContext and MapperService #63741
Conversation
ParserContext only needs some small portions of MapperService, and certainly does not need to expose MapperService through its current getter method. With this change we address this by keeping references to the needed components rather than the whole MapperService
Pinging @elastic/es-search (:Search/Mapping) |
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.
LGTM - I can already see some further cleanups opened up by this!
@@ -68,7 +68,7 @@ public static Field field(Settings settings, String path) { | |||
} | |||
|
|||
public static final TypeParser PARSER = new FixedTypeParser(c -> { | |||
final IndexSettings indexSettings = c.mapperService().getIndexSettings(); | |||
final IndexSettings indexSettings = c.getIndexSettings(); |
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.
We can probably change this to use the Version directly as a follow-up
@@ -99,7 +99,7 @@ public Builder put(MetadataFieldMapper.Builder mapper) { | |||
return this; | |||
} | |||
|
|||
public DocumentMapper build(IndexSettings indexSettings, DocumentMapperParser documentMapperParser, IndexAnalyzers indexAnalyzers) { | |||
public DocumentMapper build() { |
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.
Hah, I'm getting whiplash now.
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.
haha I had a deja vu making this change, and I did not mean for any of this to happen just two days ago. but I am lucky, I guess :)
Yes, for instance we can remove the need for |
…stic#63741) ParserContext only needs some small portions of MapperService, and certainly does not need to expose MapperService through its current getter method. With this change we address this by keeping references to the needed components rather than the whole MapperService
ParserContext only needs some small portions of MapperService, and certainly does not need to expose MapperService through its current getter method.
With this change we address this by keeping references to the needed components rather than the whole MapperService.