Skip to content

Commit

Permalink
cascade inject/etc
Browse files Browse the repository at this point in the history
  • Loading branch information
kgyrtkirk committed Dec 19, 2024
1 parent 427d507 commit 613bb56
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
package org.apache.druid.sql.calcite.util;

import com.google.inject.Binder;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Module;
import org.apache.druid.initialization.DruidModule;

Expand All @@ -35,6 +37,14 @@ public DruidModuleCollection(Module... modules)
this.subModules = modules;
}

@Inject
public void cascadeInject(Injector injector)
{
for (Module module : subModules) {
injector.injectMembers(module);
}
}

@Override
public final List<? extends com.fasterxml.jackson.databind.Module> getJacksonModules()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,13 @@ public DruidModule getCoreModule()
new LookylooModule(),
new SegmentWranglerModule(),
new ExpressionModule(),
new QueryRunnerFactoryModule()
new QueryRunnerFactoryModule(),
new BuiltInTypesModule(),
new TestSqlModule(),
new ServerModule(),
new LifecycleModule(),
new QueryableModule(),
new SqlModule()
);
}

Expand Down Expand Up @@ -1000,12 +1006,6 @@ private SqlTestFramework(Builder builder)
ArrayList<Module> overrideModules = new ArrayList<>(builder.overrideModules);

injectorBuilder.add(componentSupplier.getCoreModule());
injectorBuilder.add(new BuiltInTypesModule());
injectorBuilder.add(new TestSqlModule());
injectorBuilder.add(new ServerModule());
injectorBuilder.add(new LifecycleModule());
injectorBuilder.add(new QueryableModule());
injectorBuilder.add(new SqlModule());
overrideModules.add(new TestSetupModule(builder));
overrideModules.add(new TestSegmentsOverseer());
overrideModules.add(componentSupplier.getOverrideModule());
Expand Down

0 comments on commit 613bb56

Please sign in to comment.