| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.flume.channel.AbstractChannel
org.apache.flume.channel.BasicChannelSemantics
@InterfaceAudience.Public @InterfaceStability.Stable public abstract class BasicChannelSemantics
 An implementation of basic Channel semantics, including the
 implied thread-local semantics of the Transaction class,
 which is required to extend BasicTransactionSemantics.
 
| Constructor Summary | |
|---|---|
| BasicChannelSemantics() | |
| Method Summary | |
|---|---|
| protected abstract  BasicTransactionSemantics | createTransaction()Called to create new Transactionobjects, which must
 extendBasicTransactionSemantics. | 
|  Transaction | getTransaction()Initializes the channel if it is not already, then checks to see if there is an open transaction for this thread, creating a new one via createTransactionif not. | 
| protected  void | initialize()Called upon first getTransaction() request, while synchronized on this Channelinstance. | 
|  void | put(Event event)Ensures that a transaction exists for this thread and then delegates the putto the thread'sBasicTransactionSemanticsinstance. | 
|  Event | take()Ensures that a transaction exists for this thread and then delegates the taketo the thread'sBasicTransactionSemanticsinstance. | 
| Methods inherited from class org.apache.flume.channel.AbstractChannel | 
|---|
| configure, getLifecycleState, getName, setName, start, stop, toString | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public BasicChannelSemantics()
| Method Detail | 
|---|
protected void initialize()
 Called upon first getTransaction() request, while synchronized on
 this Channel instance.  Use this method to delay the
 initializization resources until just before the first
 transaction begins.
 
protected abstract BasicTransactionSemantics createTransaction()
 Called to create new Transaction objects, which must
 extend BasicTransactionSemantics.  Each object is used
 for only one transaction, but is stored in a thread-local and
 retrieved by getTransaction for the duration of that
 transaction.
 
public void put(Event event)
         throws ChannelException
 Ensures that a transaction exists for this thread and then
 delegates the put to the thread's BasicTransactionSemantics instance.
 
event - the event to transport.
ChannelException - in case this operation fails.Transaction.begin()
public Event take()
           throws ChannelException
 Ensures that a transaction exists for this thread and then
 delegates the take to the thread's BasicTransactionSemantics instance.
 
null if no events are
 available.
ChannelException - in case this operation fails.Transaction.begin()public Transaction getTransaction()
 Initializes the channel if it is not already, then checks to see
 if there is an open transaction for this thread, creating a new
 one via createTransaction if not.
Transaction object for the
     calling thread
 | 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||