Database Reference
In-Depth Information
agent_1.source.source-1.selector.mapping.PDT = channel-2
agent_1.source.source-1.selector.mapping.EDT = channel-2
agent_1.source.source-1.selector.default = channel-1
It is arguable that the need to explicitly specify the mapping of a header to a
channel significantly reduces the utility of the multiplexing selector. In fact,
this makes it mostly useful as a routing tool rather than a mechanism for
improving processing parallelism. In that case, a better choice would be a
load-balancing sink processor, which is described later in this chapter.
Implementing Custom Selectors
Flume also supports the implementation of custom selectors. To use this
in a configuration, simply specify the fully qualified class name (sometimes
abbreviated as FQCN) as the selector.type . For example, this tells
Flume to use the RandomSelector for agent_1 's Source:
agent_1.source.source-1.selector.type =
wiley.streaming.flume.RandomSelector
Depending on the selector implementation, other configuration parameters
might be needed to operate properly. The selector itself is implemented by
extending the AbstractChannelSelector class:
import org.apache.flume.Channel;
import org.apache.flume.Context;
import org.apache.flume.Event;
import
org.apache.flume.channel.AbstractChannelSelector;
public class RandomChannelSelector extends
AbstractChannelSelector {
List<List<Channel>> outputs = new
ArrayList<List<Channel>>();
List<Channel> empty = new
ArrayList<Channel>();
Random rng = new Random();
This class requires the implementation of three different methods. The first
is the configuration method, configure , that should extract information
Search WWH ::




Custom Search