use of org.apache.druid.jackson.JacksonModule in project druid by druid-io.
the class MetricsModuleTest method createInjector.
private static Injector createInjector(Properties properties) {
return Guice.createInjector(new JacksonModule(), new LifecycleModule(), binder -> {
binder.bind(Validator.class).toInstance(Validation.buildDefaultValidatorFactory().getValidator());
binder.bindScope(LazySingleton.class, Scopes.SINGLETON);
binder.bind(ServiceEmitter.class).toInstance(new NoopServiceEmitter());
binder.bind(Properties.class).toInstance(properties);
}, new MetricsModule());
}
use of org.apache.druid.jackson.JacksonModule in project druid by druid-io.
the class GuiceInjectors method makeDefaultStartupModules.
public static Collection<Module> makeDefaultStartupModules() {
return ImmutableList.of(new DruidGuiceExtensions(), new JacksonModule(), new PropertiesModule(Arrays.asList("common.runtime.properties", "runtime.properties")), new RuntimeInfoModule(), new ConfigModule(), new NullHandlingModule(), new ExpressionProcessingModule(), binder -> {
binder.bind(DruidSecondaryModule.class);
JsonConfigProvider.bind(binder, "druid.extensions", ExtensionsConfig.class);
JsonConfigProvider.bind(binder, "druid.modules", ModulesConfig.class);
});
}
use of org.apache.druid.jackson.JacksonModule in project druid by druid-io.
the class QueryableModuleTest method makeInjector.
private Injector makeInjector(Properties properties) {
Injector injector = Guice.createInjector(ImmutableList.of(new DruidGuiceExtensions(), new JacksonModule(), new ConfigModule(), new QueryRunnerFactoryModule(), new DruidProcessingConfigModule(), new BrokerProcessingModule(), new LifecycleModule(), binder -> {
binder.bind(Properties.class).toInstance(properties);
}, new QueryableModule()));
ObjectMapper mapper = injector.getInstance(Key.get(ObjectMapper.class, Json.class));
mapper.registerModules(new QueryableModule().getJacksonModules());
mapper.setInjectableValues(new InjectableValues.Std().addValue(ServiceEmitter.class, new NoopServiceEmitter()));
return injector;
}
use of org.apache.druid.jackson.JacksonModule in project druid by druid-io.
the class SqlModuleTest method makeInjectorWithProperties.
private Injector makeInjectorWithProperties(final Properties props) {
return Guice.createInjector(ImmutableList.of(new DruidGuiceExtensions(), new LifecycleModule(), new ServerModule(), new JacksonModule(), (Module) binder -> {
binder.bind(Validator.class).toInstance(Validation.buildDefaultValidatorFactory().getValidator());
binder.bind(JsonConfigurator.class).in(LazySingleton.class);
binder.bind(Properties.class).toInstance(props);
binder.bind(ExprMacroTable.class).toInstance(ExprMacroTable.nil());
binder.bind(AuthorizerMapper.class).toInstance(CalciteTests.TEST_AUTHORIZER_MAPPER);
binder.bind(Escalator.class).toInstance(new NoopEscalator());
binder.bind(ServiceEmitter.class).toInstance(serviceEmitter);
binder.bind(RequestLogger.class).toInstance(new NoopRequestLogger());
binder.bind(new TypeLiteral<Supplier<DefaultQueryConfig>>() {
}).toInstance(Suppliers.ofInstance(new DefaultQueryConfig(null)));
binder.bind(FilteredServerInventoryView.class).toInstance(inventoryView);
binder.bind(TimelineServerView.class).toInstance(timelineServerView);
binder.bind(DruidLeaderClient.class).annotatedWith(Coordinator.class).toInstance(druidLeaderClient);
binder.bind(DruidLeaderClient.class).annotatedWith(IndexingService.class).toInstance(druidLeaderClient);
binder.bind(DruidNodeDiscoveryProvider.class).toInstance(druidNodeDiscoveryProvider);
binder.bind(GenericQueryMetricsFactory.class).toInstance(genericQueryMetricsFactory);
binder.bind(QuerySegmentWalker.class).toInstance(querySegmentWalker);
binder.bind(QueryToolChestWarehouse.class).toInstance(queryToolChestWarehouse);
binder.bind(LookupExtractorFactoryContainerProvider.class).toInstance(lookupExtractorFactoryContainerProvider);
binder.bind(JoinableFactory.class).toInstance(joinableFactory);
binder.bind(SegmentLoader.class).toInstance(segmentLoader);
binder.bind(QuerySchedulerProvider.class).in(LazySingleton.class);
binder.bind(QueryScheduler.class).toProvider(QuerySchedulerProvider.class).in(LazySingleton.class);
}, new SqlModule(props), new TestViewManagerModule()));
}
Aggregations