apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep Deshmukh <sand...@datatorrent.com>
Subject Re: Handling idle time for operator
Date Wed, 02 Sep 2015 18:09:40 GMT
As I understand, I can get my task done earlier if I have that in
 handleIdleTime() rathe than waiting for endWindow().

But can I depend solely on  handleIdleTime() ?  Is invocation of
handleIdleTime() guaranteed in the operator per window cycle?



On Wed, Sep 2, 2015 at 7:46 AM, Pramod Immaneni <pramod@datatorrent.com>
wrote:

> The time you spend in handleIdleTime could still be less than a window
> interval. If you move your processing to end window, since end window is
> called when end window is received from upstream you would delay the
> results being sent to downstream.
>
> On Wed, Sep 2, 2015 at 1:26 AM, Bhupesh Chawda <bhupeshchawda@gmail.com>
> wrote:
>
> > Hi All,
> >
> > I understand that handleIdleTime() is called when the operator is idling
> > and is intended for auxiliary processing. Also, if the operator does not
> > have anything to do, it must block for some time to avoid busy loop.
> > What happens if my processing within handleIdleTime() exceeds the amount
> of
> > time it would have blocked otherwise? In that case does it make a
> > difference whether the processing is done in handleIdleTime() or in
> > endWindow() call?
> >
> > To clarify the question, is this the right approach:
> >
> > handleIdleTime()
> > {
> >   do some work W;
> >   t = time to do work W;
> >   sleep(SPIN_MILLIS - t);
> > }
> >
> > What is the right approach if t > SPIN_MILLIS?
> >
> > Thanks.
> > --
> > Regards,
> > Bhupesh Chawda
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message