flume-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From João Ascenso <joaoricardoasce...@gmail.com>
Subject Re: Create custom sink
Date Wed, 05 Sep 2012 10:28:28 GMT
Thanks for the response.

As for building the jar and including as a separate library, can i for
example follow the same concept as this one?
https://github.com/dunithd/flume-voldemort-plugin

João Ascenso


2012/9/4 shekhar sharma <shekhar2581@gmail.com>

> Its pretty straight forward!! You need to create a class extending from
> Abstract Sink and override the process method..
>
> For example:
> public class MyCustomSink extends AbstractSink {
>
>
> public MyCustomSink()
> {
>     //Your initialization code goes here..Constructor is called when you
> start agent
>
> }
>
> @Override
>   public Status process() throws EventDeliveryException {
>     Status result = Status.READY;
> Channel channel = getChannel();
>     Transaction transaction = channel.getTransaction();
>     Event event = null;
>     try
>  {
>      transaction.begin();
>     event = channel.take();
>    ///Now you are ready to process the event
>
> }
>
> }
>
>
> In the host properties file you need to mentioned the full class
> name..com.mycom.MyCustomSink
>
> On Tue, Sep 4, 2012 at 2:22 AM, João Ascenso <joaoricardoascenso@gmail.com
> > wrote:
>
>> Greetings,
>>
>> I'm looking to implement my own sink, is there a good tutorial on how one
>> should build the .jar and integrate with flume? I can only find tutorials
>> to versions lower than 1.x and i cant find a source saying that way is
>> still valid
>>
>>
>> Thanks in advance,
>> João Ascenso
>>
>
>

Mime
View raw message