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


Java SinkFactory类代码示例

本文整理汇总了Java中org.apache.flume.SinkFactory的典型用法代码示例。如果您正苦于以下问题:Java SinkFactory类的具体用法?Java SinkFactory怎么用?Java SinkFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SinkFactory类属于org.apache.flume包,在下文中一共展示了SinkFactory类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test

import org.apache.flume.SinkFactory; //导入依赖的package包/类
@Test
public void test() {
  Context context = new Context();
  context.put("type", FailoverSinkProcessor.class.getName());
  context.put("priority.sink1", "1");
  context.put("priority.sink2", "2");
  SinkFactory sf = new DefaultSinkFactory();
  List<Sink> sinks = new ArrayList<Sink>();
  sinks.add(sf.create("sink1", "avro"));
  sinks.add(sf.create("sink2", "avro"));
  SinkProcessor sp = SinkProcessorFactory.getProcessor(context, sinks);
  context.put("type", "failover");
  SinkProcessor sp2 = SinkProcessorFactory.getProcessor(context, sinks);
  Assert.assertEquals(sp.getClass(), sp2.getClass());
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:16,代码来源:SinkProcessorFactoryTest.java

示例2: testInstantiatingLoadBalancingSinkProcessor

import org.apache.flume.SinkFactory; //导入依赖的package包/类
@Test
public void testInstantiatingLoadBalancingSinkProcessor() {
  Context context = new Context();
  context.put("type", LoadBalancingSinkProcessor.class.getName());
  context.put("selector", "random");
  SinkFactory sf = new DefaultSinkFactory();
  List<Sink> sinks = new ArrayList<Sink>();
  sinks.add(sf.create("sink1", "avro"));
  sinks.add(sf.create("sink2", "avro"));
  SinkProcessor sp = SinkProcessorFactory.getProcessor(context, sinks);
  context.put("type", "load_balance");
  SinkProcessor sp2 = SinkProcessorFactory.getProcessor(context, sinks);
  Assert.assertEquals(sp.getClass(), sp2.getClass());
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:15,代码来源:SinkProcessorFactoryTest.java

示例3: verifySinkCreation

import org.apache.flume.SinkFactory; //导入依赖的package包/类
private void verifySinkCreation(String name, String type, Class<?> typeClass) throws FlumeException {
    SinkFactory sinkFactory = new DefaultSinkFactory();
    Sink sink = sinkFactory.create(name, type);
    Assert.assertNotNull(sink);
    Assert.assertTrue(typeClass.isInstance(sink));
}
 
开发者ID:DevOps-TangoMe,项目名称:flume-redis,代码行数:7,代码来源:TestRedisSinkCreation.java


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