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

Geo: Refactors libs/geo parser to provide serialization logic as well #43717

Merged
merged 1 commit into from
Jul 3, 2019

Conversation

imotov
Copy link
Contributor

@imotov imotov commented Jun 27, 2019

Enables libs/geo parser to return a geometry format object that can
perform both serialization and deserialization functions. This can
be useful for ingest nodes that are trying to modify an existing
geometry in the source.

Relates to #43554

Enables libs/geo parser to return a geometry format object that can
perform both serialization and deserialization functions. This can
be useful for ingest nodes that are trying to modify an existing
geometry in the source.
@imotov imotov added :Analytics/Geo Indexing, search aggregations of geo points and shapes >refactoring v8.0.0 v7.3.0 labels Jun 27, 2019
@imotov imotov requested a review from talevy June 27, 2019 20:09
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

@imotov
Copy link
Contributor Author

imotov commented Jun 27, 2019

@elasticmachine run elasticsearch-ci/default-distro

@talevy
Copy link
Contributor

talevy commented Jul 2, 2019

Hi @imotov, I noticed that my initial intentions of using this parser in #43851 via XContent is not exactly what I needed. Since IngestNode already converts the xcontent into a Map, it would be great if there was a way to parse a Map with these libs. Do you think it is fine to convert back from the Map into XContent?

I think I need to think about this some more, but I wanted to avoid going from Map -> XContent -> Circle. So I ended up parsing the Circle definition manually in the processor. I do not like this, but I am not sure how to best update these libs to support this, since it is unique to how Ingest Node parses the document.

@imotov
Copy link
Contributor Author

imotov commented Jul 2, 2019

Do you think it is fine to convert back from the Map into XContent?

I think we should start with that and then I can add another implementation of XContentParser that would "traverse" a map. We will be able to reuse it in other places as well.

@talevy
Copy link
Contributor

talevy commented Jul 2, 2019

oh cool. good to know this is similarly done elsewhere and can be improved.

/**
* Geometry serializer/deserializer
*/
public interface GeometryFormat {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we have these formats be required to provide their name via something like a String getName()? or type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you have any particular use for that?

Copy link
Contributor

Choose a reason for hiding this comment

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

guess not!

@imotov imotov merged commit eb92e01 into elastic:master Jul 3, 2019
imotov added a commit that referenced this pull request Jul 4, 2019
…#43717)

Enables libs/geo parser to return a geometry format object that can
perform both serialization and deserialization functions. This can
be useful for ingest nodes that are trying to modify an existing
geometry in the source.

Relates to #43554
@imotov imotov deleted the extract-geometry-format branch May 1, 2020 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >refactoring v7.4.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants