org.apache.flume.channel.file
Class FileChannel

java.lang.Object
  extended by org.apache.flume.channel.AbstractChannel
      extended by org.apache.flume.channel.file.FileChannel
All Implemented Interfaces:
Channel, Configurable, LifecycleAware, NamedComponent

public class FileChannel
extends AbstractChannel

A durable Channel implementation that uses the local file system for its storage.


Nested Class Summary
static class FileChannel.FileBackedTransaction
           An implementation of Transaction for FileChannels.
 
Constructor Summary
FileChannel()
           
 
Method Summary
 File getCompleteDirectory()
           
 File getDirectory()
           
 String getName()
           
 File getOpenDirectory()
           
 Transaction getTransaction()
           
 boolean isInitialized()
           
 void put(Event event)
          Puts the given event into the channel.
 void setDirectory(File directory)
           
 Event take()
          Returns the next event from the channel if available.
 
Methods inherited from class org.apache.flume.channel.AbstractChannel
configure, getLifecycleState, setName, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileChannel

public FileChannel()
Method Detail

put

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

Puts the given event into the channel.

Note: This method must be invoked within an active Transaction boundary. Failure to do so can lead to unpredictable results.

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 must return null.

Note: This method must be invoked within an active Transaction boundary. Failure to do so can lead to unpredictable results.

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()
Returns:
the transaction instance associated with this channel.

getDirectory

public File getDirectory()

setDirectory

public void setDirectory(File directory)

getOpenDirectory

public File getOpenDirectory()

getCompleteDirectory

public File getCompleteDirectory()

isInitialized

public boolean isInitialized()

getName

public String getName()
Specified by:
getName in interface NamedComponent
Overrides:
getName in class AbstractChannel


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