clintropolis commented on a change in pull request #9492: add manual laning
strategy, integration test
URL: https://github.com/apache/druid/pull/9492#discussion_r391247139
##########
File path: server/src/test/java/org/apache/druid/server/QuerySchedulerTest.java
##########
@@ -399,6 +399,49 @@ public void testMisConfigHiLo()
}
+ @Test
+ public void testConfigManual()
+ {
+ final Injector injector = createInjector();
+ final String propertyPrefix = "druid.query.scheduler";
+ final JsonConfigProvider<QuerySchedulerProvider> provider =
JsonConfigProvider.of(
+ propertyPrefix,
+ QuerySchedulerProvider.class
+ );
+ final Properties properties = new Properties();
+ properties.put(propertyPrefix + ".numThreads", "10");
+ properties.put(propertyPrefix + ".laning.strategy", "manual");
+ properties.put(propertyPrefix + ".laning.lanes.one", "1");
+ properties.put(propertyPrefix + ".laning.lanes.two", "2");
+ provider.inject(properties, injector.getInstance(JsonConfigurator.class));
+ final QueryScheduler scheduler = provider.get().get().get();
+ Assert.assertEquals(10, scheduler.getTotalAvailableCapacity());
+ Assert.assertEquals(1, scheduler.getLaneAvailableCapacity("one"));
+ Assert.assertEquals(2, scheduler.getLaneAvailableCapacity("two"));
Review comment:
Oh, I maybe interpreted this as something deeper, suggesting that we should
treat queries that specify non-existent lanes as a 0 capacity lane, because of
my poorly named `NO_CAPACITY` variable which I am going to rename as
`UNAVAILABLE` pending this discussion. If you're just suggesting that we check
that non-existent lanes return `-1` I can add that test.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]