|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Channel
A channel connects a Source to a Sink. The source acts as producer while the sink acts as a consumer of events. The channel itself is the buffer between the two.
A channel exposes a Transaction interface that can be used by its clients to ensure atomic put or remove semantics. This is necessary to guarantee single hop reliability in a logical node. For instance, a source will produce an event successfully if and only if it can be committed to the channel. Similarly, a sink will consume an event if and only if its end point can accept the event. The extent of transaction support varies for different channel implementations ranging from strong to best-effort semantics.
Channels are associated with unique names that can be used for separating configuration and working namespaces.
org.apache.flume.EventSource
,
org.apache.flume.EventSink
,
Transaction
Method Summary | |
---|---|
String |
getName()
|
Transaction |
getTransaction()
|
void |
put(Event event)
Puts the given event in the channel. |
void |
shutdown()
Instructs the channel to release any resources held in preparation of shutting down. |
Event |
take()
Returns the next event from the channel if available. |
Method Detail |
---|
void put(Event event) throws ChannelException
Puts the given event in the channel.
Note: This method must be invoked within an active Transaction boundary. Failure to do so can lead to unpredictable results.
event
- the event to transport.
ChannelException
- in case this operation fails.Transaction.begin()
Event take() throws ChannelException
Returns the next event from the channel if available. If the channel does not have any events available, this method would return null.
Note: This method must be invoked within an active Transaction boundary. Failure to do so can lead to unpredictable results.
ChannelException
- in case this operation fails.Transaction.begin()
Transaction getTransaction()
void shutdown()
String getName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |