flume-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brock Noland <br...@cloudera.com>
Subject Re: Best way to control the schedule period of process() in source/sink runner
Date Thu, 13 Sep 2012 20:28:35 GMT
Hi,

At this point I think this is appropriate for the user list.

Can you explain a little more about your use case and what you are
trying to achieve?

Brock

On Thu, Sep 13, 2012 at 1:19 PM, Shumin Wu <shumin.wu@gmail.com> wrote:
> Hi,
>
> Please enlighten me a better way to control the scheduled executing period
> of process() method in source/sink runners than the code in below.
>
>     @Override
>     public Status process() throws EventDeliveryException {
>         try {
>             Thread.sleep(period * 1000);
>         } catch (InterruptedException ie) {
>             logger.error("Process thread sleep interrupted", ie);
>         } catch (Exception ex) {
>             logger.error("Error in the empty process method", ex);
>             throw new EventDeliveryException(ex);
>         }
>         return Status.READY;
>     }
>
> What's the best practice say I need to have multiple services running at
> different period? I can of course manage my own ScheduledThreadPools, but
> does flume-ng have any utilities that is available or planned down on the
> road?
>
> Thanks,
>
> Shumin



-- 
Apache MRUnit - Unit testing MapReduce - http://incubator.apache.org/mrunit/

Mime
View raw message