Search in sources :

Example 6 with QueryPrioritizationStrategy

use of org.apache.druid.server.QueryPrioritizationStrategy in project druid by druid-io.

the class ThresholdBasedQueryPrioritizationStrategyTest method testPrioritizationPeriodThresholdInsidePeriod.

@Test
public void testPrioritizationPeriodThresholdInsidePeriod() {
    QueryPrioritizationStrategy strategy = new ThresholdBasedQueryPrioritizationStrategy("P90D", null, null, adjustment);
    DateTime startDate = DateTimes.nowUtc().minusDays(1);
    DateTime endDate = DateTimes.nowUtc();
    TimeseriesQuery query = queryBuilder.intervals(ImmutableList.of(new Interval(startDate, endDate))).granularity(Granularities.MINUTE).context(ImmutableMap.of()).build();
    Assert.assertFalse(strategy.computePriority(QueryPlus.wrap(query), ImmutableSet.of()).isPresent());
}
Also used : QueryPrioritizationStrategy(org.apache.druid.server.QueryPrioritizationStrategy) TimeseriesQuery(org.apache.druid.query.timeseries.TimeseriesQuery) DateTime(org.joda.time.DateTime) Interval(org.joda.time.Interval) Test(org.junit.Test)

Aggregations

TimeseriesQuery (org.apache.druid.query.timeseries.TimeseriesQuery)6 QueryPrioritizationStrategy (org.apache.druid.server.QueryPrioritizationStrategy)6 DateTime (org.joda.time.DateTime)6 Interval (org.joda.time.Interval)6 Test (org.junit.Test)6 SegmentServerSelector (org.apache.druid.client.SegmentServerSelector)1