Maytas Monsereenusorn
05/28/2025, 2:03 AMint toAdjust = 0
if (violatesPeriodThreshold) {
toAdjust += adjustment;
}
if (violatesDurationThreshold) {
toAdjust += adjustment;
}
if (violatesSegmentThreshold) {
toAdjust += adjustment;
}
if (violatesSegmentRangeThreshold) {
toAdjust += adjustment;
}
if (toAdjust != 0) {
final int adjustedPriority = theQuery.context().getPriority() - toAdjust;
return Optional.of(adjustedPriority);
}
• What if we can set the adjustment value for each Threshold seperately?
i.e.
int toAdjust = 0
if (violatesPeriodThreshold) {
toAdjust += periodThresholdAdjustment;
}
if (violatesDurationThreshold) {
toAdjust += durationThresholdAdjustment;
}
if (violatesSegmentThreshold) {
toAdjust += segmentThresholdAdjustment;
}
if (violatesSegmentRangeThreshold) {
toAdjust += segmentRangeThresholdAdjustment;
}
if (toAdjust != 0) {
final int adjustedPriority = theQuery.context().getPriority() - toAdjust;
return Optional.of(adjustedPriority);
}
The motivation for the first change is that if a query that violate N thresholds, it should be penalize more (not equal) to another query that violate N-1 thresholds.
The motivation for the second change is that some violate are worst than other. i.e. periodThreshold is not that bad compare to segmentRangeThreshold.
The prioritization value would then carry over to the Historical and can help with resources prioritization on Historical processing threadpool (related to this discussion https://apachedruidworkspace.slack.com/archives/C030CMF6B70/p1745436989786489). CC:@Gian Merlino @Clint WylieGian Merlino
06/03/2025, 11:22 PMGian Merlino
06/03/2025, 11:22 PMMaytas Monsereenusorn
06/03/2025, 11:23 PMGian Merlino
06/03/2025, 11:23 PMMaytas Monsereenusorn
06/03/2025, 11:23 PMMaytas Monsereenusorn
06/03/2025, 11:24 PMit’s sort of like a (simple) cost based strategyYes. Extending from the thresholds we already have
Maytas Monsereenusorn
06/03/2025, 11:26 PMGian Merlino
06/03/2025, 11:29 PM