Hi, On Fri, Oct 24, 2014 at 10:12 AM, Rajeevan Vimalanathan <[email protected]> wrote:
> Hi, > > We are writing a Siddhi Transformer for Top-K implementation by extending > TransformProcessor class. There was a need to overwrite currentState() and > restoreState() methods from TransformProcessor class. So I want to know in > which scenarios those methods are called and what should be the ideal > implementation? > > WSO2 CEP has a feature to persist snapshots to recover from failures. This is a configurable feature and once enabled, it persists snapshots of the components such as windows etc periodically. So the currentState() is where the state should be returned to persist. restoreState() gets called when CEP goes down and comes up, to restore the last saved state to resume processing from that point. So for your case, if there's anything that need to be available even after the node goes down and comes up, return it in currentState(). Also implement the restoreState() properly to restore whatever persisted. Thanks Rajeev > -- > Best Regards, > V.Rajeevan > Software Engineer, > WSO2 Inc. :http://wso2.com > > Mobile : +94 773090875 > Email : [email protected] > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Rajeev Sampath Senior Software Engineer WSO2, Inc.; http://www.wso2.com. Mobile: * +94716265766*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
