mirror of https://github.com/apache/druid.git
add bindings for chat handler provider
This commit is contained in:
parent
1843316db6
commit
c6f4b344cb
|
@ -31,6 +31,9 @@ import io.druid.segment.realtime.FireDepartment;
|
|||
import io.druid.segment.realtime.NoopSegmentPublisher;
|
||||
import io.druid.segment.realtime.RealtimeManager;
|
||||
import io.druid.segment.realtime.SegmentPublisher;
|
||||
import io.druid.segment.realtime.firehose.ChatHandlerProvider;
|
||||
import io.druid.segment.realtime.firehose.NoopChatHandlerProvider;
|
||||
import io.druid.segment.realtime.firehose.ServiceAnnouncingChatHandlerProvider;
|
||||
import io.druid.server.QueryResource;
|
||||
import io.druid.server.initialization.JettyServerInitializer;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
|
@ -57,6 +60,20 @@ public class RealtimeModule implements Module
|
|||
publisherBinder.addBinding("noop").to(NoopSegmentPublisher.class);
|
||||
binder.bind(DbSegmentPublisher.class).in(LazySingleton.class);
|
||||
|
||||
PolyBind.createChoice(
|
||||
binder,
|
||||
"druid.realtime.chathandler.type",
|
||||
Key.get(ChatHandlerProvider.class),
|
||||
Key.get(NoopChatHandlerProvider.class)
|
||||
);
|
||||
final MapBinder<String, ChatHandlerProvider> handlerProviderBinder = PolyBind.optionBinder(
|
||||
binder, Key.get(ChatHandlerProvider.class)
|
||||
);
|
||||
handlerProviderBinder.addBinding("announce")
|
||||
.to(ServiceAnnouncingChatHandlerProvider.class).in(LazySingleton.class);
|
||||
handlerProviderBinder.addBinding("noop")
|
||||
.to(NoopChatHandlerProvider.class).in(LazySingleton.class);
|
||||
|
||||
JsonConfigProvider.bind(binder, "druid.realtime", RealtimeManagerConfig.class);
|
||||
binder.bind(new TypeLiteral<List<FireDepartment>>(){})
|
||||
.toProvider(FireDepartmentsProvider.class)
|
||||
|
|
Loading…
Reference in New Issue