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] 6x Deprecate ShapeBuilders and decouple geojson parse logic #27345

Closed
wants to merge 0 commits into from

Conversation

nknize
Copy link
Contributor

@nknize nknize commented Nov 10, 2017

Like 7.0 this commit refactors the geo_shape parsing logic into its own package separate from the Shape builders and deprecates ShapeBuilders helper classes and methods. It also decouples the GeoShapeType into a standalone enumerator that is responsible for validating the parsed data and providing the appropriate builder. This future-proofs the code making it easier to maintain and not only add new shape types but support for new geo formats (e.g., WKT).

@nknize nknize added :Analytics/Geo Indexing, search aggregations of geo points and shapes review v6.1.0 labels Nov 10, 2017
@nknize nknize changed the title [GEO] Deprecate ShapeBuilders and decouple geojson parse logic [GEO] 6x Deprecate ShapeBuilders and decouple geojson parse logic Nov 10, 2017
@nknize
Copy link
Contributor Author

nknize commented Nov 10, 2017

@cbuescher This is the 6.x version of the #27212 PR. There are only 2 deprecations. ShapeBuilders class, and ShapeBuilder.parse. I also updated the migration docs. The rest of it is the same as the 7.0 PR. Let me know if I missed anything else that needed to be deprecated. Thx!

Copy link
Member

@cbuescher cbuescher left a comment

Choose a reason for hiding this comment

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

@nknize great, I left a few comments (mostly very minor nits, some might also be good to check on master), the deprecation looks good otherwise.


/**
* Created by nknize on 9/22/17.
*/
Copy link
Member

Choose a reason for hiding this comment

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

Nit: only place I seen this so far, auto-created?

*/
@Deprecated
Copy link
Member

Choose a reason for hiding this comment

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

public static void register(List<Entry> namedWriteables) is unused and can probably already be removed, should only be used internally.

* @param latitude latitude of the point
* @return a new {@link PointBuilder}
*/
public static PointBuilder newPoint(double longitude, double latitude) {
Copy link
Member

Choose a reason for hiding this comment

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

Where does this come from? Seems unused.

/** @deprecated this method will be removed in a future version; use ShapeParser.parse instead */
@Deprecated
public static ShapeBuilder parse(XContentParser parser) throws IOException {
DEPRECATION_LOGGER.deprecated("deprecated method [ShapeBuilder.parse] used; replaced by [ShapeParser.parse]");
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need deprecation logging here, I think marking the java API should be enough.

* @param coordinate
* Coordinate for the Node
*/
protected CoordinateNode(Coordinate coordinate) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: can be package private (maybe I didn't see that in the master PR)

* @param children
* Children of the Node
*/
protected CoordinateNode(List<CoordinateNode> children) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: can be package private (maybe I didn't see that in the master PR)

return (coordinate == null && (children == null || children.isEmpty()));
}

public boolean isMultiPoint() {
Copy link
Member

Choose a reason for hiding this comment

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

seems unused

@nknize nknize force-pushed the refactor/decoupleShapeParser6x branch from 174ec45 to 64c30e0 Compare November 23, 2017 04:55
@nknize nknize removed the review label Nov 23, 2017
@nknize nknize force-pushed the refactor/decoupleShapeParser6x branch from 8af2d00 to a3fd30f Compare November 23, 2017 05:14
Copy link
Member

@cbuescher cbuescher left a comment

Choose a reason for hiding this comment

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

@nknize thanks for adding those changes, LGTM

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 >deprecation v6.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants