clintropolis commented on a change in pull request #9492: add manual laning
strategy, integration test
URL: https://github.com/apache/druid/pull/9492#discussion_r391239761
##########
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:
This isn't actually true currently, non-existent lanes are currently treated
the same as not having a lane. I did this in #9407 because it seemed
friendlier, but an argument can probably made for making undefined lanes that
are present be treated as having 0 capacity which would make what you are
suggesting true. If we wanted to make this change, we could either do it across
the board in `QueryScheduler`, or leave the decision to the
`QueryLaningStrategy` which is a bit more flexible.
----------------------------------------------------------------
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]