Package org.apache.flume

Examples of org.apache.flume.SinkFactory


    private PhoenixSink sink;
  
  
    @Test
    public void testSinkCreation() {
        SinkFactory factory = new DefaultSinkFactory ();
        Sink sink = factory.create("PhoenixSink__", "org.apache.phoenix.flume.sink.PhoenixSink");
        Assert.assertNotNull(sink);
        Assert.assertTrue(PhoenixSink.class.isInstance(sink));
    }
View Full Code Here


  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());
  }
View Full Code Here

  @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());
  }
View Full Code Here

  @Before
  public void setUp() {
    ChannelFactory channelFactory = new DefaultChannelFactory();
    SourceFactory sourceFactory = new DefaultSourceFactory();
    SinkFactory sinkFactory = new DefaultSinkFactory();

    channelFactory.register("memory", MemoryChannel.class);

    sourceFactory.register("seq", SequenceGeneratorSource.class);
    sourceFactory.register("netcat", NetcatSource.class);

    sinkFactory.register("null", NullSink.class);
    sinkFactory.register("logger", LoggerSink.class);

    provider = new JsonFileConfigurationProvider();

    provider.setNodeName("localhost");
    provider.setChannelFactory(channelFactory);
View Full Code Here

    private PhoenixSink sink;
  
  
    @Test
    public void testSinkCreation() {
        SinkFactory factory = new DefaultSinkFactory ();
        Sink sink = factory.create("PhoenixSink__", "org.apache.phoenix.flume.sink.PhoenixSink");
        Assert.assertNotNull(sink);
        Assert.assertTrue(PhoenixSink.class.isInstance(sink));
    }
View Full Code Here

    private PhoenixSink sink;
  
  
    @Test
    public void testSinkCreation() {
        SinkFactory factory = new DefaultSinkFactory ();
        Sink sink = factory.create("PhoenixSink__", "com.salesforce.phoenix.flume.sink.PhoenixSink");
        Assert.assertNotNull(sink);
        Assert.assertTrue(PhoenixSink.class.isInstance(sink));
    }
View Full Code Here

TOP

Related Classes of org.apache.flume.SinkFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.