Hi Minudika, Can't you change the pointer dynamically? Restore is there exactly for that purpose; where whenever there's a requirement to rollback to a previous state, restore() would get invoked.
On Sat, Jul 8, 2017 at 12:41 PM, Minudika Malshan <minud...@wso2.com> wrote: > Hi, > > @Nirmal : > I am trying on this siddhi-io-file. I was referring the code of > siddi-io-kafka. > > @suho : Yes. It pause(), restoreState() and then resume(). But > > My issue is, > I if the siddhiApp is shutted down, when it get started again, the method > calls will happen in the following order. > > connect(), [when starting the runtime again] > pause() and then restoreState() [when restoring the snapshot] > and then, > resume(). > > I am starting the file server within connect method. For that, I need to > give the file pointer(which is updated from snapshot) to the server, so > that it can resume the file consuming process from the point where it > stopped previously. > > Since the connect() method is called before restore() method, I cannot > find the restored file pointer before starting the file server. > > Any comment on this? Should I move to the file server starting thing to > resume() also? > > Thanks and regards! > > > On Fri, Jul 7, 2017 at 10:25 PM, Nirmal Fernando <nir...@wso2.com> wrote: > >> @Minudika Can you elaborate a bit? What code you're referring to? >> >> On Fri, Jul 7, 2017 at 8:45 PM, Sriskandarajah Suhothayan <s...@wso2.com> >> wrote: >> >>> To my knowledge it's doing a pause() restoreState() and then resume(). >>> >>> Am I wrong? >>> >>> On Fri, Jul 7, 2017 at 6:28 PM, Minudika Malshan <minud...@wso2.com> >>> wrote: >>> >>>> Hi, >>>> >>>> When restarting a siddhiAppRuntime with restoring a snapshot of the >>>> source, it calls the connect() method in source and then restoreState() >>>> method. >>>> >>>> Since the source is supposed to do the process using previously >>>> captured state, shouldn't the order be restore() and then connect() ? >>>> >>>> Appreciate if you can help me to clarify this. >>>> >>>> Thanks and regards! >>>> >>>> -- >>>> *Minudika Gammanpila* >>>> Software Engineer - WSO2 >>>> >>>> Email : minud...@wso2.com >>>> Mobile : +94715659887 <071%20565%209887> >>>> Web : http://wso2.com <http://wso2.com/signature> >>>> >>> >>> >>> >>> -- >>> >>> *S. Suhothayan* >>> Associate Director / Architect >>> *WSO2 Inc. *http://wso2.com >>> * <http://wso2.com/>* >>> lean . enterprise . middleware >>> >>> >>> *cell: (+94) 779 756 757 <+94%2077%20975%206757> | blog: >>> http://suhothayan.blogspot.com/ <http://suhothayan.blogspot.com/>twitter: >>> http://twitter.com/suhothayan <http://twitter.com/suhothayan> | linked-in: >>> http://lk.linkedin.com/in/suhothayan <http://lk.linkedin.com/in/suhothayan>* >>> >> >> >> >> -- >> >> Thanks & regards, >> Nirmal >> >> Technical Lead, WSO2 Inc. >> Mobile: +94715779733 <+94%2071%20577%209733> >> Blog: http://nirmalfdo.blogspot.com/ >> >> >> > > > -- > *Minudika Gammanpila* > Software Engineer - WSO2 > > Email : minud...@wso2.com > Mobile : +94715659887 <+94%2071%20565%209887> > Web : http://wso2.com <http://wso2.com/signature> > -- Thanks & regards, Nirmal Technical Lead, WSO2 Inc. Mobile: +94715779733 Blog: http://nirmalfdo.blogspot.com/
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev