Re: how to maintain state in ProcessElement

2013-07-10 Thread Matthieu Morel
On Jul 10, 2013, at 20:01 , Jiaan Zeng wrote: > By reset I mean that variable is 0 every time when onEvent() is > called. Sorry for the confusion. From the wordcount point of view, it > is correct because the "int wordCounter;" is incremented to 1 in > onEvent(). I don't understand when and whe

Re: how to maintain state in ProcessElement

2013-07-10 Thread Jiaan Zeng
By reset I mean that variable is 0 every time when onEvent() is called. Sorry for the confusion. From the wordcount point of view, it is correct because the "int wordCounter;" is incremented to 1 in onEvent(). I don't understand when and where the variable is reset to 0. On Wed, Jul 10, 2013 at 1

Re: how to maintain state in ProcessElement

2013-07-10 Thread Matthieu Morel
On Jul 10, 2013, at 17:30 , Jiaan Zeng wrote: > Hi, > > I wonder how to maintain state in ProcessElement. For example, > > s4-core/src/test/java/org/apache/s4/wordcount/WordCountPE.java > The variable "int wordCounter;" is used in onEvent() function and is > reset to zero after the onEvent() f