Examples of SinkFactory


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

Examples of org.apache.flume.SinkFactory

  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

Examples of org.apache.flume.SinkFactory

  @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

Examples of org.apache.flume.SinkFactory

  @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

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

Examples of org.apache.flume.SinkFactory

    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

Examples of org.apache.maven.doxia.sink.SinkFactory

            if ( getLog().isDebugEnabled() )
            {
                getLog().debug( "Parser used: " + parser.getClass().getName() );
            }

            SinkFactory sinkFactory;
            try
            {
                sinkFactory = ConverterUtil.getSinkFactory( plexus, output.getFormat(), SUPPORTED_TO_FORMAT );
            }
            catch ( ComponentLookupException e )
            {
                throw new ConverterException( "ComponentLookupException: " + e.getMessage(), e );
            }

            Sink sink;
            try
            {
                sink = sinkFactory.createSink( output.getOutputStream(), output.getEncoding() );
            }
            catch ( IOException e )
            {
                throw new ConverterException( "IOException: " + e.getMessage(), e );
            }
View Full Code Here

Examples of org.apache.maven.doxia.sink.SinkFactory

        catch ( IOException e )
        {
            throw new ConverterException( "IOException: " + e.getMessage(), e );
        }

        SinkFactory sinkFactory;
        try
        {
            sinkFactory = ConverterUtil.getSinkFactory( plexus, output.getFormat(), SUPPORTED_TO_FORMAT );
        }
        catch ( ComponentLookupException e )
        {
            throw new ConverterException( "ComponentLookupException: " + e.getMessage(), e );
        }

        Sink sink;
        try
        {
            String outputEncoding;
            if ( StringUtils.isEmpty( output.getEncoding() )
                || output.getEncoding().equals( OutputFileWrapper.AUTO_ENCODING ) )
            {
                outputEncoding = inputEncoding;
            }
            else
            {
                outputEncoding = output.getEncoding();
            }

            OutputStream out = new FileOutputStream( outputFile );
            sink = sinkFactory.createSink( out, outputEncoding );
        }
        catch ( IOException e )
        {
            throw new ConverterException( "IOException: " + e.getMessage(), e );
        }
View Full Code Here

Examples of org.apache.maven.doxia.sink.SinkFactory

        if ( supportedFormats == null )
        {
            throw new IllegalArgumentException( "supportedFormats is required" );
        }

        SinkFactory factory = null;

        for ( int i = 0; i < supportedFormats.length; i++ )
        {
            if ( format.equalsIgnoreCase( supportedFormats[i] ) )
            {
View Full Code Here

Examples of org.apache.maven.doxia.sink.SinkFactory

            sink.rawText(element.html());
    }
  }
 
  private void createReport(String reportName, Locale locale, Document document) {
        SinkFactory factory = getSinkFactory();
        Sink sink = factory.createSink(getReportOutputDirectory(), reportName);
        sinkBeginReport(sink, getBundle( locale ));
        sink.rawText(document.html());
        //addElements(sink, document.head().getElementsByTag("link"));
    //addElements(sink, document.head().getElementsByTag("script"));
    //addElements(sink, document.body().children());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.