-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add limit to geojson upload API #218
Add limit to geojson upload API #218
Conversation
@@ -61,9 +64,28 @@ public static UploadGeoJSONRequestContent create(Map<String, Object> input) { | |||
geoJSONData + " is not an instance of List, but of type [ " + geoJSONData.getClass().getName() + " ]" | |||
); | |||
} | |||
final long featureCount = getFeatureCount(geoJSONData); | |||
if (featureCount > MAX_SUPPORTED_GEOJSON_FEATURE_COUNT) { |
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.
Do you want to add a comment here that why we are setting the max limit to 10_000?
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 added comment close to constant
@@ -61,9 +64,28 @@ public static UploadGeoJSONRequestContent create(Map<String, Object> input) { | |||
geoJSONData + " is not an instance of List, but of type [ " + geoJSONData.getClass().getName() + " ]" | |||
); | |||
} | |||
final long featureCount = getFeatureCount(geoJSONData); | |||
if (featureCount > MAX_SUPPORTED_GEOJSON_FEATURE_COUNT) { |
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, can we break this down into a separate method like validateFeatureCount(geoJSONData) { ....}
?
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.
created new method
Will limit upto 10_000 features to upload. Signed-off-by: Vijayan Balasubramanian <[email protected]>
ed87490
to
d7656cf
Compare
Description
Upload API will limit number of features to be uploaded to 10_000. Since custom vector map will allow 10K documents to
be fetched, we will add same constraint while upload for consistency .
Signed-off-by: Vijayan Balasubramanian [email protected]
Issues Resolved
opensearch-project/dashboards-maps#220
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.