Closed patrickzurek closed 8 years ago
JIRA Coment by user: banderson JIRA Timestamp: 2011-03-07 08:55 PM
Comment body:
services should check timestamps on config files and code files to see if they need to reprocess all records.
JIRA Coment by user: jbrand JIRA Timestamp: 2011-05-02 05:33 PM
Comment body:
On startup of the MST, each installed service is checked for updated files. If any are found, the contents of service_harvests associated with the updated service are deleted. The service must then reprocess by finding all processing directives where the service is the target, and reexecuting these directives.
Design
New database column A new column has been added to the metadataservicestoolkit.services table of type Timestamp: services_last_updated. On initial service install this gets populated with the latest file time found for the service.
New properties
Two new properties have been introduced: 1.regexpOfFilesToScanForAutoServiceReprocessing 2.isCheckingForUpdatedServiceFiles
Only files types found in property regexpOfFilesToScanForAutoServiceReprocessing shall be considered when deciding whether a service has been updated. By default these file types are: .jar,..class,..xccfg,..properties but this is configurable. Note the regex syntax used to describe the file types. As a regular expression is constructed to determine if the file type matches, please use regular expressions if you modify the property regexpOfFilesToScanForAutoServiceReprocessing.
This feature can be disabled with new property: isCheckingForUpdatedServiceFiles, by default the MST checks for updated service files.
Testing¶Check that the new column is populated after install of a new service: "select service_last_modified from metadataservicestoolkit.services where service_id=1"
For operations after this initial one I used a system set up through MARCNormalization start2finishtest.
Update a service's file that is of a type not in the list above (like an html file). Through checking debug statements in the general log, make sure the service was seen as 'not updated' on restart of the MST through Tomcat stop/start.
Update a service's file that is of a type in the list above (like a xccfg file). Assure the contents of service_harvests associated with the updated service are deleted: "select * from metadataservicestoolkit.service_harvests where service_id=1"
Then, after reprocessing, check that the harvest exists again using the same query.
To do: •Test multiple processing rules all run for an updated service. •Create a more automated unit test.
JIRA Coment by user: jbrand JIRA Timestamp: 2011-05-05 05:16 PM
Comment body:
Unit test complete.
Other work completed as per 5/2/11 entry.
JIRA Coment by user: rcook JIRA Timestamp: 2011-05-11 06:53 PM
Comment body:
Tested as spec in req found on wiki at ...
Issue resolved: 2011-05-11 06:53 PM
JIRA issue created by: rcook Originally opened: 2010-11-11 06:26 PM
Issue body: (nt)