|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.flume.channel.MemoryChannel
public class MemoryChannel
Memory channel that with full transaction support Uses transaction object for each thread (source and sink) attached to channel. The events are stored in the thread safe Dequeue. * The put and take are directly executed in the common queue. Channel has a marker for the last committed event in order to avoid sink reading uncommitted data. The transactions keep track of the actions to perform undo when rolled back.
| Nested Class Summary | |
|---|---|
class |
MemoryChannel.MemTransaction
|
| Constructor Summary | |
|---|---|
MemoryChannel()
Channel constructor |
|
| Method Summary | |
|---|---|
void |
configure(Context context)
set the event queue capacity |
protected MemoryChannel.MemTransaction |
findTransaction()
|
protected void |
forgetTransaction(MemoryChannel.MemTransaction myTxn)
Remove the given transaction from the list of open transactions |
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. |
protected void |
undoPut(MemoryChannel.MemTransaction myTxn)
undo of put for all the events in the undoPut queue, remove those from the event queue |
protected void |
undoTake(MemoryChannel.MemTransaction myTxn)
undo of take operation for each event in the undoTake list, add it back to the event queue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MemoryChannel()
| 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()protected void undoPut(MemoryChannel.MemTransaction myTxn)
myTxn - 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()protected void undoTake(MemoryChannel.MemTransaction myTxn)
myTxn - public Transaction getTransaction()
getTransaction in interface Channelprotected void forgetTransaction(MemoryChannel.MemTransaction myTxn)
myTxn - protected MemoryChannel.MemTransaction findTransaction()
public 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 | |||||||||