flume-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shumin Wu <shumin...@gmail.com>
Subject Best way to control the schedule period of process() in source/sink runner
Date Thu, 13 Sep 2012 18:19:18 GMT
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

Mime
View raw message