org.apache.flume
Interface Sink

All Superinterfaces:
LifecycleAware, NamedComponent
All Known Implementing Classes:
AbstractSink, AsyncHBaseSink, AvroSink, HBaseSink, HDFSEventSink, IRCSink, LoggerSink, NullSink, RollingFileSink

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.

See Also:
Channel, SinkProcessor, SinkRunner

Nested Class Summary
static class Sink.Status
           
 
Method Summary
 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
 
Methods inherited from interface org.apache.flume.lifecycle.LifecycleAware
getLifecycleState, start, stop
 
Methods inherited from interface org.apache.flume.NamedComponent
getName, setName
 

Method Detail

setChannel

void setChannel(Channel channel)

Sets the channel the sink will consume from

Parameters:
channel - The channel to be polled

getChannel

Channel getChannel()
Returns:
the channel associated with this sink

process

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.

Returns:
READY if 1 or more Events were successfully delivered, BACKOFF if no data could be retrieved from the channel feeding this sink
Throws:
EventDeliveryException - In case of any kind of failure to deliver data to the next hop destination.


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