mshahid6 opened a new pull request, #19665:
URL: https://github.com/apache/druid/pull/19665
### Description
Follow-up to the weighted query laning strategy (#19225).
**Configurable per-threshold weights (`WeightedQueryLaningStrategy`)**
Previously every breached threshold added exactly 1 to a query's cost. This
adds optional per-threshold weights so a breach on one dimension can count for
more than another (e.g. a huge segment scan should outweigh a slightly-old
interval). Each weight defaults to 1, so existing configs are unchanged.
New optional properties (each an integer >= 1, default 1): `periodWeight`,
`durationWeight`, `segmentCountWeight`, `segmentRangeWeight`.
a weight must be >= 1 and its corresponding threshold must be configured
Example. A segment-count breach counts double, so a query breaching only
segmentCount still reaches a cost-2 lane:
```
{
"strategy": "weighted",
"segmentCountThreshold": 1000,
"durationThreshold": "P1D",
"segmentCountWeight": 2,
"lanes": {
"low": { "minCost": 1, "maxPercent": 30 },
"very-low": { "minCost": 2, "maxPercent": 10 }
}
}
```
**`id` dimension on the `query/priority` metric (`QueryScheduler`)**
Also adds the query `id` dimension for easily finding a query's priority.
### Key changed classes
- `WeightedQueryLaningStrategy` — optional per-threshold weight fields +
validation
- `QueryScheduler` — `id` dimension on the `query/priority` metric
### Release note
The `weighted` query laning strategy now supports optional per-threshold
cost weights (`periodWeight`, `durationWeight`, `segmentCountWeight`,
`segmentRangeWeight`; default 1), and the `query/priority` metric now includes
a `id` dimension.
This PR has:
- [ ] been self-reviewed.
- [ ] using the [concurrency
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
(Remove this item if the PR doesn't have any relation to concurrency.)
- [x] added documentation for new or modified features or behaviors.
- [x] a release note entry in the PR description.
- [x] added Javadocs for most classes and all non-trivial methods. Linked
related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [ ] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [ ] added integration tests.
- [ ] been tested in a test Druid cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]