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.
Modifier and Type | Method and Description |
---|---|
Iterator<Sink> |
createSinkIterator() |
void |
informSinkFailed(Sink failedSink) |
void |
setSinks(List<Sink> sinks) |
configure
getLifecycleState, start, stop
Copyright © 2009-2017 Apache Software Foundation. All Rights Reserved.