org.apache.flume.channel.jdbc
Class JdbcChannel

java.lang.Object
  extended by org.apache.flume.channel.jdbc.JdbcChannel
All Implemented Interfaces:
Channel, Configurable

public class JdbcChannel
extends Object
implements Channel, Configurable

A JDBC based channel implementation.


Constructor Summary
JdbcChannel()
          Instantiates a new JDBC Channel.
 
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

JdbcChannel

public JdbcChannel()
Instantiates a new JDBC Channel.

Method Detail

put

public void put(Event event)
         throws ChannelException
Description copied from interface: Channel

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.

Specified by:
put in interface Channel
Parameters:
event - the event to transport.
Throws:
ChannelException - in case this operation fails.
See Also:
Transaction.begin()

take

public Event take()
           throws ChannelException
Description copied from interface: Channel

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.

Specified by:
take in interface Channel
Returns:
the next available event or null if no events are available.
Throws:
ChannelException - in case this operation fails.
See Also:
Transaction.begin()

getTransaction

public Transaction getTransaction()
Specified by:
getTransaction in interface Channel
Returns:
the transaction instance associated with this channel.

shutdown

public void shutdown()
Description copied from interface: Channel
Instructs the channel to release any resources held in preparation of shutting down.

Specified by:
shutdown in interface Channel

getName

public String getName()
Specified by:
getName in interface Channel
Returns:
the channel name.

configure

public void configure(Context context)
Specified by:
configure in interface Configurable


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