You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by MaGuoWei <ma...@outlook.com> on 2015/07/30 11:33:20 UTC

question about SlidingPreReducer.java

hi guysThere is a function updateCurrent() in this class(SlidingPreReducer).I think there is no chance to run the following code in this function:currentReduced = reducer.reduce(serializer.copy(currentReduced), element);Can any one give me a example that can run this code.  (I have already see all the test case)thanks a lot
 		 	   		  

Re: question about SlidingPreReducer.java

Posted by Aljoscha Krettek <al...@apache.org>.
Hi,
I also had this suspicion in the past. The sliding pre reducers are
horribly slow. For example, this code:

ds.window(...).every(...).mapWindow(new MyWindowMapReducer())

is a lot faster than this:

ds.window(...).every(...).reduceWindow(new MyWindowReducer())

We are currently working on this for the next release (0.10).

On Thu, 30 Jul 2015 at 11:54 MaGuoWei <ma...@outlook.com> wrote:

> hi till
> I mean the branch of the if statement is never execute.
> thanks
>
> 发自我的 iPhone
>
> > 在 2015年7月30日,下午5:51,Till Rohrmann <ti...@gmail.com> 写道:
> >
> > Hi MaGuoWei,
> >
> > do you mean that the branch of the if statement (line 130) is never
> > executed? Or are you looking for an example which uses the
> SlidingPreReducer
> > ?
> >
> > Cheers,
> > Till
> > ​
> >
> >> On Thu, Jul 30, 2015 at 11:33 AM, MaGuoWei <ma...@outlook.com>
> wrote:
> >>
> >> hi guysThere is a function updateCurrent() in this
> >> class(SlidingPreReducer).I think there is no chance to run the following
> >> code in this function:currentReduced =
> >> reducer.reduce(serializer.copy(currentReduced), element);Can any one
> give
> >> me a example that can run this code.  (I have already see all the test
> >> case)thanks a lot
> >>
>

Re: question about SlidingPreReducer.java

Posted by Aljoscha Krettek <al...@apache.org>.
Yes, this is also what I figured.

On Thu, 30 Jul 2015 at 12:21 MaGuoWei <ma...@outlook.com> wrote:

> I find function addToBufferIfEligible always resets currentReduced to null
> so that branch can never be reached.  (SlidingCountPreReducer.java)
>
>
> > Date: Thu, 30 Jul 2015 12:06:54 +0200
> > Subject: Re: question about SlidingPreReducer.java
> > From: till.rohrmann@gmail.com
> > To: dev@flink.apache.org
> >
> > But if the updateCurrent method is called at least twice with a value
> > different from null, then the else branch should be executed if I’m not
> > mistaken. In the first call currentReduced will be sets to something
> other
> > than null (if branch) and in the second call the reducer will be called
> > with the next element (else branch).
> > ​
> >
> > On Thu, Jul 30, 2015 at 11:54 AM, MaGuoWei <ma...@outlook.com> wrote:
> >
> > > hi till
> > > I mean the branch of the if statement is never execute.
> > > thanks
> > >
> > > 发自我的 iPhone
> > >
> > > > 在 2015年7月30日,下午5:51,Till Rohrmann <ti...@gmail.com> 写道:
> > > >
> > > > Hi MaGuoWei,
> > > >
> > > > do you mean that the branch of the if statement (line 130) is never
> > > > executed? Or are you looking for an example which uses the
> > > SlidingPreReducer
> > > > ?
> > > >
> > > > Cheers,
> > > > Till
> > > > ​
> > > >
> > > >> On Thu, Jul 30, 2015 at 11:33 AM, MaGuoWei <ma...@outlook.com>
> > > wrote:
> > > >>
> > > >> hi guysThere is a function updateCurrent() in this
> > > >> class(SlidingPreReducer).I think there is no chance to run the
> following
> > > >> code in this function:currentReduced =
> > > >> reducer.reduce(serializer.copy(currentReduced), element);Can any one
> > > give
> > > >> me a example that can run this code.  (I have already see all the
> test
> > > >> case)thanks a lot
> > > >>
> > >
>

RE: question about SlidingPreReducer.java

Posted by MaGuoWei <ma...@outlook.com>.
I find function addToBufferIfEligible always resets currentReduced to null so that branch can never be reached.  (SlidingCountPreReducer.java)
 

> Date: Thu, 30 Jul 2015 12:06:54 +0200
> Subject: Re: question about SlidingPreReducer.java
> From: till.rohrmann@gmail.com
> To: dev@flink.apache.org
> 
> But if the updateCurrent method is called at least twice with a value
> different from null, then the else branch should be executed if I’m not
> mistaken. In the first call currentReduced will be sets to something other
> than null (if branch) and in the second call the reducer will be called
> with the next element (else branch).
> ​
> 
> On Thu, Jul 30, 2015 at 11:54 AM, MaGuoWei <ma...@outlook.com> wrote:
> 
> > hi till
> > I mean the branch of the if statement is never execute.
> > thanks
> >
> > 发自我的 iPhone
> >
> > > 在 2015年7月30日,下午5:51,Till Rohrmann <ti...@gmail.com> 写道:
> > >
> > > Hi MaGuoWei,
> > >
> > > do you mean that the branch of the if statement (line 130) is never
> > > executed? Or are you looking for an example which uses the
> > SlidingPreReducer
> > > ?
> > >
> > > Cheers,
> > > Till
> > > ​
> > >
> > >> On Thu, Jul 30, 2015 at 11:33 AM, MaGuoWei <ma...@outlook.com>
> > wrote:
> > >>
> > >> hi guysThere is a function updateCurrent() in this
> > >> class(SlidingPreReducer).I think there is no chance to run the following
> > >> code in this function:currentReduced =
> > >> reducer.reduce(serializer.copy(currentReduced), element);Can any one
> > give
> > >> me a example that can run this code.  (I have already see all the test
> > >> case)thanks a lot
> > >>
> >
 		 	   		  

Re: question about SlidingPreReducer.java

Posted by Till Rohrmann <ti...@gmail.com>.
But if the updateCurrent method is called at least twice with a value
different from null, then the else branch should be executed if I’m not
mistaken. In the first call currentReduced will be sets to something other
than null (if branch) and in the second call the reducer will be called
with the next element (else branch).
​

On Thu, Jul 30, 2015 at 11:54 AM, MaGuoWei <ma...@outlook.com> wrote:

> hi till
> I mean the branch of the if statement is never execute.
> thanks
>
> 发自我的 iPhone
>
> > 在 2015年7月30日,下午5:51,Till Rohrmann <ti...@gmail.com> 写道:
> >
> > Hi MaGuoWei,
> >
> > do you mean that the branch of the if statement (line 130) is never
> > executed? Or are you looking for an example which uses the
> SlidingPreReducer
> > ?
> >
> > Cheers,
> > Till
> > ​
> >
> >> On Thu, Jul 30, 2015 at 11:33 AM, MaGuoWei <ma...@outlook.com>
> wrote:
> >>
> >> hi guysThere is a function updateCurrent() in this
> >> class(SlidingPreReducer).I think there is no chance to run the following
> >> code in this function:currentReduced =
> >> reducer.reduce(serializer.copy(currentReduced), element);Can any one
> give
> >> me a example that can run this code.  (I have already see all the test
> >> case)thanks a lot
> >>
>

Re: question about SlidingPreReducer.java

Posted by MaGuoWei <ma...@outlook.com>.
hi till
I mean the branch of the if statement is never execute.
thanks

发自我的 iPhone

> 在 2015年7月30日,下午5:51,Till Rohrmann <ti...@gmail.com> 写道:
> 
> Hi MaGuoWei,
> 
> do you mean that the branch of the if statement (line 130) is never
> executed? Or are you looking for an example which uses the SlidingPreReducer
> ?
> 
> Cheers,
> Till
> ​
> 
>> On Thu, Jul 30, 2015 at 11:33 AM, MaGuoWei <ma...@outlook.com> wrote:
>> 
>> hi guysThere is a function updateCurrent() in this
>> class(SlidingPreReducer).I think there is no chance to run the following
>> code in this function:currentReduced =
>> reducer.reduce(serializer.copy(currentReduced), element);Can any one give
>> me a example that can run this code.  (I have already see all the test
>> case)thanks a lot
>> 

Re: question about SlidingPreReducer.java

Posted by Till Rohrmann <ti...@gmail.com>.
Hi MaGuoWei,

do you mean that the branch of the if statement (line 130) is never
executed? Or are you looking for an example which uses the SlidingPreReducer
?

Cheers,
Till
​

On Thu, Jul 30, 2015 at 11:33 AM, MaGuoWei <ma...@outlook.com> wrote:

> hi guysThere is a function updateCurrent() in this
> class(SlidingPreReducer).I think there is no chance to run the following
> code in this function:currentReduced =
> reducer.reduce(serializer.copy(currentReduced), element);Can any one give
> me a example that can run this code.  (I have already see all the test
> case)thanks a lot
>