|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.flume.channel.PseudoTxnMemoryChannel
public class PseudoTxnMemoryChannel
A capacity-capped Channel implementation that supports in-memory
buffering and delivery of events.
This channel is appropriate for
best effort
delivery of events where high throughput is favored over
data durability. To be clear, this channel offers absolutely no guarantee
of event delivery in the face of (any) component failure.
TODO: Discuss guarantees, corner cases re: potential data loss (e.g. consumer begins a tx, takes events, and gets SIGKILL before rollback).
Configuration options
| Parameter | Description | Unit / Type | Default |
|---|---|---|---|
| capacity | The in-memory capacity of this channel. Store up to capacity events before refusing new events. | events / int | 50 |
| keep-alive | The amount of time (seconds) to wait for an event before returning
null on take(). |
seconds / int | 3 |
Metrics
TODO
| Nested Class Summary | |
|---|---|
static class |
PseudoTxnMemoryChannel.NoOpTransaction
A no-op transaction implementation that does nothing at all. |
| Constructor Summary | |
|---|---|
PseudoTxnMemoryChannel()
|
|
| Method Summary | |
|---|---|
void |
configure(Context context)
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PseudoTxnMemoryChannel()
| Method Detail |
|---|
public void configure(Context context)
configure in interface Configurablepublic void put(Event event)
ChannelPuts 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.
put in interface Channelevent - the event to transport.Transaction.begin()public Event take()
ChannelReturns 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.
take in interface ChannelTransaction.begin()public Transaction getTransaction()
getTransaction in interface Channelpublic void shutdown()
Channel
shutdown in interface Channelpublic String getName()
getName in interface Channel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||