@InterfaceAudience.Public @InterfaceStability.Stable public interface Sink extends LifecycleAware, NamedComponent
A sink is connected to a Channel and consumes its contents, sending them to a configured destination that may vary according to the sink type.
Sinks can be grouped together for various behaviors using SinkGroup and SinkProcessor. They are polled periodically by a SinkRunner via the processor
Sinks are associated with unique names that can be used for separating configuration and working namespaces.
While the process()
call is guaranteed to only be accessed
by a single thread, other calls may be concurrently accessed and should
thus be protected.
Channel
,
SinkProcessor
,
SinkRunner
Modifier and Type | Interface and Description |
---|---|
static class |
Sink.Status |
Modifier and Type | Method and Description |
---|---|
Channel |
getChannel() |
Sink.Status |
process()
Requests the sink to attempt to consume data from attached channel
|
void |
setChannel(Channel channel)
Sets the channel the sink will consume from
|
getLifecycleState, start, stop
getName, setName
void setChannel(Channel channel)
Sets the channel the sink will consume from
channel
- The channel to be polledChannel getChannel()
Sink.Status process() throws EventDeliveryException
Requests the sink to attempt to consume data from attached channel
Note: This method should be consuming from the channel within the bounds of a Transaction. On successful delivery, the transaction should be committed, and on failure it should be rolled back.
EventDeliveryException
- In case of any kind of failure to
deliver data to the next hop destination.Copyright © 2009–2019 Apache Software Foundation. All rights reserved.