kgyrtkirk commented on code in PR #17572:
URL: https://github.com/apache/druid/pull/17572#discussion_r1888216723
##########
server/src/main/java/org/apache/druid/guice/DruidBinders.java:
##########
@@ -62,32 +66,68 @@ public static MapBinder<Class<? extends Query>, QueryLogic>
queryLogicBinderType
);
}
- public static QueryLogicBinder queryLogicBinder(Binder binder)
+ public static QueryBinder queryBinder(Binder binder)
{
- return new QueryLogicBinder(binder);
+ return new QueryBinder(binder);
}
- public static class QueryLogicBinder
+ public static class QueryBinder
{
- private MapBinder<Class<? extends Query>, QueryLogic> queryLogicMapBinder;
- private Binder binder;
+ MapBinderHelper<Class<? extends Query>, QueryLogic> queryLogicBinder;
+ MapBinderHelper<Class<? extends Query>, QueryRunnerFactory>
queryRunnerFactoryBinder;
+ MapBinderHelper<Class<? extends Query>, QueryToolChest>
queryToolChestBinder;
+
- public QueryLogicBinder(Binder binder)
+ public QueryBinder(Binder binder)
{
- this.binder = binder;
- queryLogicMapBinder = DruidBinders.queryLogicBinderType(binder);
+ queryLogicBinder = new MapBinderHelper<>(
+ binder, queryLogicBinderType(binder),
ImmutableSet.of(LazySingleton.class)
Review Comment:
I don't think anyone will need that - this class pushes the contract that
all `queryX` classes must be `LazySingleton` -s.
Why shouldn't all `queryX` be `LazySingleton`-s?
Since `DefaultQueryRunnerFactoryConglomerate` will pick up all these and
hand it out to other components in the system - I'm not sure if we need
`LazySingleton` here..
--
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]