当前位置: 首页>>代码示例>>Java>>正文


Java ReplicatingChannelSelector类代码示例

本文整理汇总了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));
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:17,代码来源:TestAvroSource.java

示例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);

}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:22,代码来源:TestSyslogUdpSource.java

示例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);

}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:21,代码来源:TestSyslogTcpSource.java

示例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();
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:17,代码来源:TestSpoolDirectorySource.java

示例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));
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:22,代码来源:TestNetcatSource.java

示例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";
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:18,代码来源:TestTaildirSource.java

示例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();
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:26,代码来源:TestScribeSource.java

示例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));
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:17,代码来源:TestNetcatSource.java

示例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();
}
 
开发者ID:yandex,项目名称:opentsdb-flume,代码行数:23,代码来源:LegacyHttpSourceTest.java

示例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();
}
 
开发者ID:yandex,项目名称:opentsdb-flume,代码行数:22,代码来源:OpenTSDBSourceTest.java

示例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();
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:23,代码来源:FlumeDestinationPipelineRunIT.java

示例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();
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:20,代码来源:TestFlumeThriftTarget.java

示例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();
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:20,代码来源:TestFlumeFailoverTarget.java

示例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();
}
 
开发者ID:cloudera,项目名称:cdk,代码行数:27,代码来源:TestLog4jAppenderWithAvro.java

示例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));
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:10,代码来源:TestThriftSource.java


注:本文中的org.apache.flume.channel.ReplicatingChannelSelector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。