Add POST /tableConfigs/tune endpoint to apply tuning and return tuned config#18056
Add POST /tableConfigs/tune endpoint to apply tuning and return tuned config#18056rseetham wants to merge 1 commit intoapache:masterfrom
Conversation
…igs and returns the tuned config.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18056 +/- ##
============================================
+ Coverage 63.34% 63.35% +0.01%
+ Complexity 1543 1540 -3
============================================
Files 3200 3200
Lines 194222 194237 +15
Branches 29934 29931 -3
============================================
+ Hits 123026 123065 +39
+ Misses 61526 61509 -17
+ Partials 9670 9663 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| * ensuring min replicas and storage quota constraints, and returns the tuned TableConfigs. | ||
| */ | ||
| @POST | ||
| @Path("/tableConfigs/tune") |
There was a problem hiding this comment.
Instead of a new endpoint, could we consider adding a applyTuneConfigs param to POST /tableConfigs/validate since this endpoint validates as well as applies tuner configs to the input table config - hence it is an extension of the validate endpoint.
There was a problem hiding this comment.
Validate also tuning configs is not obvious. The tune configs could be extended in the future for more tuning. The validate is there to make sure the tuning does not fail devise the input is invalid.
What is this PR doing / why is it needed?
The existing
POST /tableConfigs/validateendpoint validates the providedTableConfigsand returns the input as-is (modulo database name translation). However, the actual create (POST /tableConfigs) and update (PUT /tableConfigs/{tableName}) paths apply additional tuning before persisting:realtimeAutoIndexTuner)This means callers have no way to preview what would actually be stored without performing the real operation.
This PR adds a new
POST /tableConfigs/tuneendpoint that validates theTableConfigsand then applies the same tuning as create/update, returning the resulting config. This lets callers preview the final tuned config before committing.Changes
POST /tableConfigs/tuneendpoint inTableConfigsRestletResourceparseAndValidateTableConfigshelper, used by bothvalidateandtuneendpointstuneConfig(TableConfig, Schema)helper toapplyTuningto avoid name collision with the new public endpoint methodforTableConfigsTune()toControllerRequestURLBuildertestTuneConfigtest inTableConfigsRestletResourceTestcovering: invalid input, min replicas, dim table quota, tuner config application, and unrecognized properties passthroughTesting Done
All existing
TableConfigsRestletResourceTesttests pass. NewtestTuneConfigtest added and passing.