Info |
---|
Valid from Datafari 6.0 |
1. Reminder: what is Atomic Update?
...
atomicUpdateLastExec: contains the job(s) status and last execution date and time (more details in ).To modify these files you need to be root user.
To modify these files you need to be datafari user or belong to root group.
...
Code Block | ||
---|---|---|
| ||
{ "logConfigFile": "", // Specify the log configuration file location if it is different from the provided one in the "atomicupdates" directory or if you want to move it in another location. "jobs": { "JOB_1": { // Put the name you want for this configuration "source": { // Define the Intermediary Solr, OCR or Spacy in our example above "baseUrl": Solr Cloud base Url for the source Collection used to update target Collection. You can specify Solr or Zookeeper host, but prefer the Zookeeper host as Datafari use it to dispatch to all Solr hosts you have. (For information) The syntax for Solr host is: "http://datafari_domain:8983/solr", ex: "http(s)://localhost:8983/solr" ; you need to specify all Solr hosts. Do not specify https url, because it is the proxy-based url to specify here. The syntax for Zookeeper is: "datafari_domain:2181", ex: "localhost:2181" ; No http prefix because it's another protocol. Whatever host type, you can define several severs by separating URLs with comma, but using Zookeeper, there is only one server. Example with solr host: "http://solr1:8983/solr, http://solr2:8983/solr,...". "solrCollection": the Solr source Collection for JOB_1. Example "Spacy". }, "destination": { // Define the final Solr, FileShare in our example above. "baseUrl": Solr Cloud base Url for the target Collection. The syntax is the same as in "source" block. "solrCollection": the Solr target Collection for JOB_1. Example "FileShare". }, "fieldsOperation": { // the fields of the source collection and Atomic Update operation like: set, add, remove, etc... // the "set" operation will be the more appropriate value for most cases, as it replaces the target value with the source value. // see more about operations available here: https://solr.apache.org/guide/solr/9_5/indexing-guide/partial-document-updates.html#atomic-updates "field_1": "set", "field_2": "add", "field_3": "add-distinct", "field_4": "set" }, "nbDocsPerBatch": The documents are selected and updated per batches. This represents the number of documents per batch fetched from the intermediary Solr ("solrCollection" in the "source" parameter, for instance the Spacy Solr collection) up to the final Solr ("solrCollection" in the "destination" parameter, the FileShare collection in our illustration above). Each batch is stored in RAM so this number depends on the data size retrieved (i.e fields and their content). You can give a try for instance to values 1000 for OCR sources and 2000 for Spacy sources, and play with them to optimise your atomic updates performances. "fieldsMapping": { // Optional: to specify a mapping between source and destination collections (remove the content of the bloc if you don't need mapping, like this: "fieldsMapping": {}) "field_3": "dest_field_1", "field_2": "dest_field_2" } }, "JOB_2": { // Put the name you want for this configuration ... } } } |
...
It may be convenient to force this date if you want to update documents from a date before the last execution date of the job (which is the default behavior). An other good reason to force this date, is to avoid a full crawl after a previous crash of the job. In this particular case, you will need to modify the job status to DONE in the “atomicUpdateLastExec“ file, otherwise the full crawl will still be executed. See more in and .Specify "fullTo clarify more, see https://datafari.atlassian.net/wiki/spaces/DATAFARI/pages/2939387906/Atomic+Update+Management#When-the-job-is-done and https://datafari.atlassian.net/wiki/spaces/DATAFARI/pages/2939387906/Atomic+Update+Management#What-happens-when-a-job-fails%3F.
Specify "full" (not case sensitive) to force full crawl. A Full crawl may be necessary if for some reason, one or more of your jobs in the Atomic Update chain has run a full crawl causing the overwriting of fields to be updated by Atomic Update.
...
In this example, the Atomic Update runs everyday at 1:15 AM.
When the job is done
At the Here is another example for a weekly job, each Monday at 4 AM:
Code Block |
---|
0 4 * * 1 /opt/datafari/bin/atomicupdates/atomic-updates-launcher.sh OCR |
When the job is done
At the end of the job, its status and execution date is written in the file “atomicUpdateLastExec” (in [DATAFARI_HOME]/bin/atomicupdates).This file is created after the first execution of Atomic Update and is common to all jobs configured. Example, for the OCR
...
Code Block |
---|
INFO 2024-03-12T14:58:24Z (main) - Datafari-jar|Atomic Update|francelabs.datafari.SolrAtomicUpdateLauncher|OCR Job started ! INFO 2024-03-12T14:58:24Z (main) - Datafari-jar|Atomic Update|datafari.save.JobSaver|The Last execution file doesn't exists yet. It will be created by the first Atomic Update Job execution. INFO 2024-03-12T14:58:24Z (main) - Datafari-jar|Atomic Update|francelabs.datafari.SolrAtomicUpdateLauncher|OCR Job: Select documents modified from: null (null indicates a full crawl)) INFO 2024-03-12T14:58:24Z (main) - Datafari-jar|Atomic Update|datafari.save.JobSaver|Job OCR RUNNING INFO 2024-03-12T14:58:24Z (main) - Datafari-jar|Atomic Update|solrj.impl.ZkClientClusterStateProvider|Cluster at localhost:2181 ready ERROR 2024-03-12T14:58:25Z (main) - Datafari-jar|Atomic Update|francelabs.datafari.SolrAtomicUpdateLauncher|OCR Job: Total number of documents processed: 0 java.lang.NullPointerException: null at com.francelabs.datafari.solraccessors.DocumentsUpdator.createSolrDocToUpdate(DocumentsUpdator.java:114) ~[datafari-solr-atomic-update-6.1-dev-Community.jar:?] at com.francelabs.datafari.solraccessors.DocumentsUpdator.updateDocuments(DocumentsUpdator.java:62) ~[datafari-solr-atomic-update-6.1-dev-Community.jar:?] at com.francelabs.datafari.SolrAtomicUpdateLauncher.main(SolrAtomicUpdateLauncher.java:133) [datafari-solr-atomic-update-6.1-dev-Community.jar:?] INFO 2024-03-12T14:58:25Z (main) - Datafari-jar|Atomic Update|datafari.save.JobSaver|Job OCR FAILED |
Here is the beginning lines of log at next run after job failed:
Code Block |
---|
INFO 2024-03-12T17:06:59Z (main) - Datafari-jar|Atomic Update|francelabs.datafari.SolrAtomicUpdateLauncher|OCR Job started !
INFO 2024-03-12T17:06:59Z (main) - Datafari-jar|Atomic Update|francelabs.datafari.SolrAtomicUpdateLauncher|OCR Job: Select documents modified from: 2024-03-12T14:28:32.428Z (null indicates a full crawl))
INFO 2024-03-12T17:06:59Z (main) - Datafari-jar|Atomic Update|francelabs.datafari.SolrAtomicUpdateLauncher|OCR Job: Last state was FAILED, so a full crawl is done for this run.
INFO 2024-03-12T17:06:59Z (main) - Datafari-jar|Atomic Update|datafari.save.JobSaver|Job OCR RUNNING
and so on... |