org.apache.flume.sink

## Interface LoadBalancingSinkProcessor.SinkSelector

- All Superinterfaces:
    Configurable, LifecycleAware
  All Known Implementing Classes:
    AbstractSinkSelector
  Enclosing class:
    LoadBalancingSinkProcessor

      public static interface LoadBalancingSinkProcessor.SinkSelector
      extends Configurable, LifecycleAware

  An interface that allows the LoadBalancingSinkProcessor to use a load-balancing strategy such as round-robin, random distribution etc. Implementations of this class can be plugged into the system via processor configuration and are used to select a sink on every invocation.

  An instance of the configured sink selector is create during the processor configuration, its setSinks(List) method is invoked following which it is configured via a subcontext. Once configured, the lifecycle of this selector is tied to the lifecycle of the sink processor.

  At runtime, the processor invokes the `createSinkIterator()` method for every `process` call to create an iteration order over the available sinks. The processor then loops through this iteration order until one of the sinks succeeds in processing the event. If the iterator is exhausted and none of the sinks succeed, the processor will raise an `EventDeliveryException`.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Iterator<Sink>` | `createSinkIterator()`
    `void` | `informSinkFailed(Sink failedSink)`
    `void` | `setSinks(List<Sink> sinks)`

    - ### Methods inherited from interface org.apache.flume.conf.Configurable

      `configure`

    - ### Methods inherited from interface org.apache.flume.lifecycle.LifecycleAware

      `getLifecycleState, start, stop`

- - ### Method Detail

    - #### setSinks

          void setSinks(List<Sink> sinks)

    - #### createSinkIterator

          Iterator<Sink> createSinkIterator()

    - #### informSinkFailed

          void informSinkFailed(Sink failedSink)

Copyright © 2009-2016 Apache Software Foundation. All Rights Reserved.