diff --git a/config-model/src/main/java/com/yahoo/schema/processing/IndexingValidation.java b/config-model/src/main/java/com/yahoo/schema/processing/IndexingValidation.java index 1011fb2617f2..63c2c55e850b 100644 --- a/config-model/src/main/java/com/yahoo/schema/processing/IndexingValidation.java +++ b/config-model/src/main/java/com/yahoo/schema/processing/IndexingValidation.java @@ -40,8 +40,6 @@ public class IndexingValidation extends Processor { @Override public void process(boolean validate, boolean documentsOnly) { - if ( ! validate) return; - VerificationContext context = new VerificationContext(new MyAdapter(schema)); for (SDField field : schema.allConcreteFields()) { ScriptExpression script = field.getIndexingScript(); diff --git a/docprocs/src/main/java/com/yahoo/docprocs/indexing/IndexingProcessor.java b/docprocs/src/main/java/com/yahoo/docprocs/indexing/IndexingProcessor.java index c5cf72b351d4..dec87c3ab4ae 100644 --- a/docprocs/src/main/java/com/yahoo/docprocs/indexing/IndexingProcessor.java +++ b/docprocs/src/main/java/com/yahoo/docprocs/indexing/IndexingProcessor.java @@ -43,14 +43,14 @@ public class IndexingProcessor extends DocumentProcessor { public final static String INDEXING_START = "indexingStart"; public final static String INDEXING_END = "indexingEnd"; - private final DocumentTypeManager docTypeMgr; - private final ScriptManager scriptMgr; + private final DocumentTypeManager documentTypeManager; + private final ScriptManager scriptManager; private final AdapterFactory adapterFactory; private class ExpressionSelector extends SimpleAdapterFactory.SelectExpression { @Override public Expression selectExpression(DocumentType documentType, String fieldName) { - return scriptMgr.getScript(documentType, fieldName).getExpression(); + return scriptManager.getScript(documentType, fieldName).getExpression(); } } @@ -59,8 +59,8 @@ public IndexingProcessor(DocumentTypeManager documentTypeManager, IlscriptsConfig ilscriptsConfig, Linguistics linguistics, ComponentRegistry embedders) { - docTypeMgr = documentTypeManager; - scriptMgr = new ScriptManager(docTypeMgr, ilscriptsConfig, linguistics, toMap(embedders)); + this.documentTypeManager = documentTypeManager; + scriptManager = new ScriptManager(this.documentTypeManager, ilscriptsConfig, linguistics, toMap(embedders)); adapterFactory = new SimpleAdapterFactory(new ExpressionSelector()); } @@ -88,17 +88,17 @@ public Progress process(Processing proc) { } DocumentTypeManager getDocumentTypeManager() { - return docTypeMgr; + return documentTypeManager; } private void processDocument(DocumentPut input, List out) { DocumentType hadType = input.getDocument().getDataType(); - DocumentScript script = scriptMgr.getScript(hadType); + DocumentScript script = scriptManager.getScript(hadType); if (script == null) { out.add(input); return; } - DocumentType wantType = docTypeMgr.getDocumentType(hadType.getName()); + DocumentType wantType = documentTypeManager.getDocumentType(hadType.getName()); Document inputDocument = input.getDocument(); if (hadType != wantType) { // this happens when you have a concrete document; we need to @@ -108,7 +108,7 @@ private void processDocument(DocumentPut input, List out) { DocumentSerializer serializer = DocumentSerializerFactory.createHead(buffer); serializer.write(inputDocument); buffer.flip(); - inputDocument = docTypeMgr.createDocument(buffer); + inputDocument = documentTypeManager.createDocument(buffer); } Document output = script.execute(adapterFactory, inputDocument); if (output == null) return; @@ -117,7 +117,7 @@ private void processDocument(DocumentPut input, List out) { } private void processUpdate(DocumentUpdate input, List out) { - DocumentScript script = scriptMgr.getScript(input.getType()); + DocumentScript script = scriptManager.getScript(input.getType()); if (script == null) { out.add(input); return; 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 3088083912bc..39ac44119f9f 100644 --- a/docprocs/src/main/java/com/yahoo/docprocs/indexing/ScriptManager.java +++ b/docprocs/src/main/java/com/yahoo/docprocs/indexing/ScriptManager.java @@ -26,23 +26,23 @@ public class ScriptManager { private static final FastLogger log = FastLogger.getLogger(ScriptManager.class.getName()); private static final String FULL = "[all]"; private final Map> documentFieldScripts; - private final DocumentTypeManager docTypeMgr; + private final DocumentTypeManager documentTypeManager; - public ScriptManager(DocumentTypeManager docTypeMgr, IlscriptsConfig config, Linguistics linguistics, + public ScriptManager(DocumentTypeManager documentTypeManager, IlscriptsConfig config, Linguistics linguistics, Map embedders) { - this.docTypeMgr = docTypeMgr; - documentFieldScripts = createScriptsMap(docTypeMgr, config, linguistics, embedders); + this.documentTypeManager = documentTypeManager; + documentFieldScripts = createScriptsMap(documentTypeManager, config, linguistics, embedders); } private Map getScripts(DocumentType inputType) { Map scripts = documentFieldScripts.get(inputType.getName()); if (scripts != null) return scripts; for (Map.Entry> entry : documentFieldScripts.entrySet()) { - if (inputType.inherits(docTypeMgr.getDocumentType(entry.getKey()))) + if (inputType.inherits(documentTypeManager.getDocumentType(entry.getKey()))) return entry.getValue(); } for (Map.Entry> entry : documentFieldScripts.entrySet()) { - if (docTypeMgr.getDocumentType(entry.getKey()).inherits(inputType)) + if (documentTypeManager.getDocumentType(entry.getKey()).inherits(inputType)) return entry.getValue(); } return null; @@ -104,7 +104,7 @@ private static Map> createScriptsMap(Docume DocumentScript documentScript = new DocumentScript(ilscript.doctype(), inputFieldNames, script); fieldScripts.put(fieldName, documentScript); } else { - log.log(Level.FINE, "Non single(" + inputFieldNames.size() +"" + + log.log(Level.FINE, "Non single(" + inputFieldNames.size() + ") inputs = " + inputFieldNames + ". Script = " + statement); } }