本文整理汇总了Java中org.apache.flume.channel.ReplicatingChannelSelector类的典型用法代码示例。如果您正苦于以下问题:Java ReplicatingChannelSelector类的具体用法?Java ReplicatingChannelSelector怎么用?Java ReplicatingChannelSelector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ReplicatingChannelSelector类属于org.apache.flume.channel包,在下文中一共展示了ReplicatingChannelSelector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
@Before
public void setUp() throws UnknownHostException {
localhost = InetAddress.getByName("127.0.0.1");
source = new AvroSource();
channel = new MemoryChannel();
Configurables.configure(channel, new Context());
List<Channel> channels = new ArrayList<Channel>();
channels.add(channel);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
source.setChannelProcessor(new ChannelProcessor(rcs));
}
示例2: init
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
private void init(String keepFields) {
source = new SyslogUDPSource();
channel = new MemoryChannel();
Configurables.configure(channel, new Context());
List<Channel> channels = new ArrayList<Channel>();
channels.add(channel);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
source.setChannelProcessor(new ChannelProcessor(rcs));
Context context = new Context();
context.put("host", InetAddress.getLoopbackAddress().getHostAddress());
context.put("port", String.valueOf(TEST_SYSLOG_PORT));
context.put("keepFields", keepFields);
source.configure(context);
}
示例3: init
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
private void init(String keepFields) {
source = new SyslogTcpSource();
channel = new MemoryChannel();
Configurables.configure(channel, new Context());
List<Channel> channels = new ArrayList<>();
channels.add(channel);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
source.setChannelProcessor(new ChannelProcessor(rcs));
Context context = new Context();
context.put("port", String.valueOf(TEST_SYSLOG_PORT));
context.put("keepFields", keepFields);
source.configure(context);
}
示例4: setUp
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
@Before
public void setUp() {
source = new SpoolDirectorySource();
channel = new MemoryChannel();
Configurables.configure(channel, new Context());
List<Channel> channels = new ArrayList<Channel>();
channels.add(channel);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
source.setChannelProcessor(new ChannelProcessor(rcs));
tmpDir = Files.createTempDir();
}
示例5: setUp
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
/**
* We set up the the Netcat source and Flume Memory Channel on localhost
*
* @throws UnknownHostException
*/
@Before
public void setUp() throws UnknownHostException {
localhost = InetAddress.getByName("127.0.0.1");
source = new NetcatSource();
channel = new MemoryChannel();
Configurables.configure(channel, new Context());
List<Channel> channels = new ArrayList<Channel>();
channels.add(channel);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
source.setChannelProcessor(new ChannelProcessor(rcs));
}
示例6: setUp
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
@Before
public void setUp() {
source = new TaildirSource();
channel = new MemoryChannel();
Configurables.configure(channel, new Context());
List<Channel> channels = new ArrayList<Channel>();
channels.add(channel);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
source.setChannelProcessor(new ChannelProcessor(rcs));
tmpDir = Files.createTempDir();
posFilePath = tmpDir.getAbsolutePath() + "/taildir_position_test.json";
}
示例7: setUpClass
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
@BeforeClass
public static void setUpClass() throws Exception {
port = findFreePort();
Context context = new Context();
context.put("port", String.valueOf(port));
scribeSource = new ScribeSource();
scribeSource.setName("Scribe Source");
Configurables.configure(scribeSource, context);
memoryChannel = new MemoryChannel();
Configurables.configure(memoryChannel, context);
List<Channel> channels = new ArrayList<Channel>(1);
channels.add(memoryChannel);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
memoryChannel.start();
scribeSource.setChannelProcessor(new ChannelProcessor(rcs));
scribeSource.start();
}
示例8: setUp
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
@Before
public void setUp() {
logger.info("Running setup");
channel = new MemoryChannel();
source = new NetcatSource();
Context context = new Context();
Configurables.configure(channel, context);
List<Channel> channels = Lists.newArrayList(channel);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
source.setChannelProcessor(new ChannelProcessor(rcs));
}
示例9: before
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
protected final void before() throws Throwable {
super.before();
source = new LegacyHttpSource();
channel = new MemoryChannel();
context = new Context();
context.put("port", Integer.toString(port));
context.put("tsdb.url", "http://" + tsdbHostPort);
context.put("keep-alive", "1");
context.put("capacity", "1000");
context.put("transactionCapacity", "1000");
Configurables.configure(source, context);
Configurables.configure(channel, context);
rcs = new ReplicatingChannelSelector();
rcs.setChannels(Lists.newArrayList(channel));
source.setChannelProcessor(new ChannelProcessor(rcs));
source.start();
}
示例10: before
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
protected final void before() throws Throwable {
super.before();
source = new OpenTSDBSource();
channel = new MemoryChannel();
context = new Context();
context.put("port", Integer.toString(port));
context.put("capacity", Integer.toString(CHANNEL_SIZE));
context.put("transactionCapacity", Integer.toString(CHANNEL_SIZE));
context.put("keep-alive", "0");
context.put("batchSize", Integer.toString(CHANNEL_SIZE));
Configurables.configure(source, context);
Configurables.configure(channel, context);
rcs = new ReplicatingChannelSelector();
rcs.setChannels(Lists.newArrayList(channel));
source.setChannelProcessor(new ChannelProcessor(rcs));
source.start();
}
示例11: setUp
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
@Before
@Override
public void setUp() throws Exception {
super.setUp();
//setup flume to write to
source = new AvroSource();
ch = new MemoryChannel();
Configurables.configure(ch, new Context());
Context context = new Context();
//This should match whats present in the pipeline.json file
context.put("port", String.valueOf(9050));
context.put("bind", "localhost");
Configurables.configure(source, context);
List<Channel> channels = new ArrayList<>();
channels.add(ch);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
source.setChannelProcessor(new ChannelProcessor(rcs));
source.start();
}
示例12: setUp
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
port = NetworkUtils.getRandomPort();
source = new ThriftSource();
ch = new MemoryChannel();
Configurables.configure(ch, new Context());
Context context = new Context();
context.put("port", String.valueOf(port));
context.put("bind", "localhost");
Configurables.configure(source, context);
List<Channel> channels = new ArrayList<>();
channels.add(ch);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
source.setChannelProcessor(new ChannelProcessor(rcs));
source.start();
}
示例13: setUp
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
port = NetworkUtils.getRandomPort();
source = new AvroSource();
ch = new MemoryChannel();
Configurables.configure(ch, new Context());
Context context = new Context();
context.put("port", String.valueOf(port));
context.put("bind", "localhost");
Configurables.configure(source, context);
List<Channel> channels = new ArrayList<>();
channels.add(ch);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
source.setChannelProcessor(new ChannelProcessor(rcs));
source.start();
}
示例14: setUp
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
URL schemaUrl = getClass().getClassLoader().getResource("myrecord.avsc");
Files.copy(Resources.newInputStreamSupplier(schemaUrl),
new File("/tmp/myrecord.avsc"));
int port = 25430;
source = new AvroSource();
ch = new MemoryChannel();
Configurables.configure(ch, new Context());
Context context = new Context();
context.put("port", String.valueOf(port));
context.put("bind", "localhost");
Configurables.configure(source, context);
List<Channel> channels = new ArrayList<Channel>();
channels.add(ch);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
source.setChannelProcessor(new ChannelProcessor(rcs));
source.start();
}
示例15: configureSource
import org.apache.flume.channel.ReplicatingChannelSelector; //导入依赖的package包/类
private void configureSource() {
List<Channel> channels = new ArrayList<Channel>();
channels.add(channel);
ChannelSelector rcs = new ReplicatingChannelSelector();
rcs.setChannels(channels);
source.setChannelProcessor(new ChannelProcessor(rcs));
}