diff options
author | Jon Bratseth <bratseth@gmail.com> | 2023-01-20 10:48:10 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2023-01-20 10:48:10 +0100 |
commit | 1e29c4da6f91d13a6889d1b71058a09fcbb4eb43 (patch) | |
tree | cd7f25f3bb5822c7be685f3fd1c5c9aa679f903b /docprocs | |
parent | 2cf4cc1f2a4ad1adace9b0e5877d9fbed6983323 (diff) |
Cleanup - no functional changes
Diffstat (limited to 'docprocs')
-rw-r--r-- | docprocs/src/main/java/com/yahoo/docprocs/indexing/ScriptManager.java | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/docprocs/src/main/java/com/yahoo/docprocs/indexing/ScriptManager.java b/docprocs/src/main/java/com/yahoo/docprocs/indexing/ScriptManager.java index acc5a2066c9..00ee3a90420 100644 --- a/docprocs/src/main/java/com/yahoo/docprocs/indexing/ScriptManager.java +++ b/docprocs/src/main/java/com/yahoo/docprocs/indexing/ScriptManager.java @@ -36,23 +36,15 @@ public class ScriptManager { private Map<String, DocumentScript> getScripts(DocumentType inputType) { Map<String, DocumentScript> scripts = documentFieldScripts.get(inputType.getName()); - if (scripts != null) { - log.log(Level.FINE, "Using script for type '%s'.", inputType.getName()); - return scripts; - } + if (scripts != null) return scripts; for (Map.Entry<String, Map<String, DocumentScript>> entry : documentFieldScripts.entrySet()) { - if (inputType.inherits(docTypeMgr.getDocumentType(entry.getKey()))) { - log.log(Level.FINE, "Using script of super-type '%s'.", entry.getKey()); + if (inputType.inherits(docTypeMgr.getDocumentType(entry.getKey()))) return entry.getValue(); - } } for (Map.Entry<String, Map<String, DocumentScript>> entry : documentFieldScripts.entrySet()) { - if (docTypeMgr.getDocumentType(entry.getKey()).inherits(inputType)) { - log.log(Level.FINE, "Using script of sub-type '%s'.", entry.getKey()); + if (docTypeMgr.getDocumentType(entry.getKey()).inherits(inputType)) return entry.getValue(); - } } - log.log(Level.FINE, "No script for type '%s'.", inputType.getName()); return null; } @@ -64,17 +56,14 @@ public class ScriptManager { Map<String, DocumentScript> fieldScripts = getScripts(inputType); if (fieldScripts != null) { DocumentScript script = fieldScripts.get(inputFieldName); - if (script != null) { - log.log(Level.FINE, "Using script for type '%s' and field '%s'.", inputType.getName(), inputFieldName); - return script; - } + if (script != null) return script; } return null; } /** - * Returns an unmodifiable map from document type name to a map of the scripts which must be run given an update - * to each possible field in that type. + * Returns an unmodifiable map from document type name to a map of the subset of indexing statements + * to run for each input field which *only* depend on that field. */ private static Map<String, Map<String, DocumentScript>> createScriptsMap(DocumentTypeManager docTypeMgr, IlscriptsConfig config, @@ -116,7 +105,8 @@ public class ScriptManager { DocumentScript documentScript = new DocumentScript(ilscript.doctype(), inputFieldNameExtractor.getInputFieldNames(), script); fieldScripts.put(fieldName, documentScript); } else { - log.log(Level.FINE, "Non single(" + inputFieldNameExtractor.getInputFieldNames().size() +") inputs = " + inputFieldNameExtractor.getInputFieldNames() + ". Script = " + statement); + log.log(Level.FINE, "Non single(" + inputFieldNameExtractor.getInputFieldNames().size() +"" + + ") inputs = " + inputFieldNameExtractor.getInputFieldNames() + ". Script = " + statement); } } |