Class ServiceAnnouncingChatHandlerProvider
java.lang.Object
org.apache.druid.segment.realtime.ServiceAnnouncingChatHandlerProvider
- All Implemented Interfaces:
ChatHandlerProvider
Provides a way for the outside world to talk to objects in the indexing service. The
get(String) method
allows anyone with a reference to this object to obtain a particular ChatHandler. An embedded
ServiceAnnouncer will be used to advertise handlers on this host.-
Constructor Summary
ConstructorsConstructorDescriptionServiceAnnouncingChatHandlerProvider(DruidNode node, ServiceAnnouncer serviceAnnouncer) -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.base.Optional<ChatHandler>Retrieves a chat handler.voidregister(String service, ChatHandler handler) Registers a chat handler which provides an API for others to talk to objects in the indexing service.voidregister(String service, ChatHandler handler, boolean announce) Registers a chat handler which provides an API for others to talk to objects in the indexing service.voidunregister(String service) Unregisters a chat handler.
-
Constructor Details
-
ServiceAnnouncingChatHandlerProvider
@Inject public ServiceAnnouncingChatHandlerProvider(DruidNode node, ServiceAnnouncer serviceAnnouncer)
-
-
Method Details
-
register
Description copied from interface:ChatHandlerProviderRegisters a chat handler which provides an API for others to talk to objects in the indexing service. Depending on the implementation, this method may also announce this node so that it can be discovered by other services.- Specified by:
registerin interfaceChatHandlerProvider- Parameters:
service- a unique name identifying this servicehandler- instance which implements the API to be exposed
-
register
Description copied from interface:ChatHandlerProviderRegisters a chat handler which provides an API for others to talk to objects in the indexing service. Setting announce to false instructs the implementation to only register the handler to expose the API and skip any discovery announcements that might have been broadcast.- Specified by:
registerin interfaceChatHandlerProvider- Parameters:
service- a unique name identifying this servicehandler- instance which implements the API to be exposedannounce- for implementations that have a service discovery mechanism, whether this node should be announced
-
unregister
Description copied from interface:ChatHandlerProviderUnregisters a chat handler.- Specified by:
unregisterin interfaceChatHandlerProvider- Parameters:
service- the name of the service
-
get
Description copied from interface:ChatHandlerProviderRetrieves a chat handler.- Specified by:
getin interfaceChatHandlerProvider- Parameters:
key- the name of the service
-