Hi, the analysis engines do not necessarily need to be created anew. If you want, you can create a jira issue for it and I will fix it.
There is currently no option to reload the dictionaries separately. As a workaround, you could extract/refactor all dictionary logic to a separate ruta analysis engine/script and then only set to parameter to true for this one. Best, Peter Am 01.02.2016 um 20:04 schrieb Miguel Alvarez: > Hi Peter, > > Thanks for your reply. > > It isn't necessarily causing any problems, I just wanted to understand how > it was meant to work. But I can explain to you a bit better my situation, > and maybe you have a better suggestion. > > We are currently setting the parameter reloadScript to true in our RUTA > engines so the dictionaries reload without us having to restart the service. > > But we have some external engines, invoked from RUTA scripts, which create > connections to other servers, and until now we have been storing this > connections as class instance variables in our external engines so they can > be reused and the engine doesn't need to create a new connection for every > document processed. And the initialize method checks whether the engine > instance has already an open connection, so no matter how many times the > initialize method is invoked only one connection is established. > > But if we invoke this external engine from a RUTA script that has the > reloadScript parameter set to true, a new instance of the engine is created > for every document processed, and therefore a new connection to the remote > server will be established for each document too, regardless of my check for > an existing connection in the initialize method (obviously because it is a > brand new instance every time). > > I guess one question I have is: Can we force the reload of dictionaries > directly from the RUTA script or in any other way? > > Thanks, > Miguel > > -----Original Message----- > From: Peter Klügl [mailto:[email protected]] > Sent: February 1, 2016 10:00 > To: [email protected] > Subject: Re: Ruta: reloadScript and external engines > > Hi, > > yes, this is correct and intended, but it is missing the original idea and > thus it is probably not necessary. > > The reload of the script needs to be supported for some special use cases > like changing the rules during the pipeline processing. The additional > analysis engine are however directly specified in the configuration > parameters and should only be changed with reconfigure(). > > Does this cause problems? I would not change it right now because I am also > thinking about removing these parameters at all in a next major release > since they are redundant and could be induced using the script files. The > objects could be cached, but the initialize is normally the expensive part. > > Best, > > Peter > > Am 30.01.2016 um 23:33 schrieb Miguel Alvarez: >> Hi Peter, >> >> >> >> I have another question about external engines :- ) When the >> reloadScript parameter is set to false only one instance of the >> external engine is created and the initialize method is invoked only >> once before processing all the CASes. This is what I was expecting. >> But when the reloadScript is set to true the initialize method of the >> external engines is invoked once per CAS, as the documentation >> indicates, but it looks like a new instance of the external engine is > created for each CAS too. Is this the expected behaviour? >> I was expecting for RUTA to create just once instance of the engine, >> and then on that instance invoke the initialize method once per CAS, >> but I couldn't find any information about this on the documentation. >> >> >> >> Thanks again. >> >> >> >> Cheers, >> >> Miguel >> >> >
