org.apache.flume.channel
Class ChannelProcessor

java.lang.Object
  extended by org.apache.flume.channel.ChannelProcessor
All Implemented Interfaces:
Configurable

public class ChannelProcessor
extends Object
implements Configurable

A channel processor exposes operations to put Events into Channels. These operations will propagate a ChannelException if any errors occur while attempting to write to required channels. Each channel processor instance is configured with a ChannelSelector instance that specifies which channels are required and which channels are optional.


Constructor Summary
ChannelProcessor(ChannelSelector selector)
           
 
Method Summary
 void close()
           
 void configure(Context context)
          The Context of the associated Source is passed.
 ChannelSelector getSelector()
           
 void initialize()
           
 void processEvent(Event event)
          Attempts to put the given event into each configured channel.
 void processEventBatch(List<Event> events)
          Attempts to put the given events into each configured channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelProcessor

public ChannelProcessor(ChannelSelector selector)
Method Detail

initialize

public void initialize()

close

public void close()

configure

public void configure(Context context)
The Context of the associated Source is passed.

Specified by:
configure in interface Configurable
Parameters:
context -

getSelector

public ChannelSelector getSelector()

processEventBatch

public void processEventBatch(List<Event> events)
Attempts to put the given events into each configured channel. If any required channel throws a ChannelException, that exception will be propagated.

Note that if multiple channels are configured, some Transactions may have already been committed while others may be rolled back in the case of an exception.

Parameters:
events - A list of events to put into the configured channels.
Throws:
ChannelException - when a write to a required channel fails.

processEvent

public void processEvent(Event event)
Attempts to put the given event into each configured channel. If any required channel throws a ChannelException, that exception will be propagated.

Note that if multiple channels are configured, some Transactions may have already been committed while others may be rolled back in the case of an exception.

Parameters:
event - The event to put into the configured channels.
Throws:
ChannelException - when a write to a required channel fails.


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