Class SwitchingEmitter

    • Constructor Detail

      • SwitchingEmitter

        public SwitchingEmitter​(Map<String,​List<Emitter>> feedToEmitters,
                                Emitter[] defaultEmitter)
        Constructor for the SwitchingEmitter
        Parameters:
        feedToEmitters - Map of feed to a list of emitters that correspond to each feed,
        defaultEmitter - A list of emitters to use if there isn't a match of feed to an emitter
    • Method Detail

      • start

        public void start()
        Start the emitter. This will start all the emitters the SwitchingEmitter uses.
        Specified by:
        start in interface Emitter
      • emit

        public void emit​(Event event)
        Emit an event. This method must not throw exceptions or block. The emitters that this uses must also not throw exceptions or block.

        This emitter will direct events based on feed to a list of emitters specified. If there is no match the event will use a list of default emitters instead.

        Emitters that this emitter uses that receive too many events and internal queues fill up, should drop events rather than blocking or consuming excessive memory.

        If an emitter that this emitter uses receives input it considers to be invalid, or has an internal problem, it should deal with that by logging a warning rather than throwing an exception. Emitters that log warnings should consider throttling warnings to avoid excessive logs, since a busy Druid cluster can emit a high volume of events.

        Specified by:
        emit in interface Emitter
        Parameters:
        event - The event that will be emitted.