aboutsummaryrefslogtreecommitdiffstats
path: root/docproc/src/main/java/com/yahoo/docproc/Processing.java
diff options
context:
space:
mode:
Diffstat (limited to 'docproc/src/main/java/com/yahoo/docproc/Processing.java')
-rw-r--r--docproc/src/main/java/com/yahoo/docproc/Processing.java85
1 files changed, 14 insertions, 71 deletions
diff --git a/docproc/src/main/java/com/yahoo/docproc/Processing.java b/docproc/src/main/java/com/yahoo/docproc/Processing.java
index 834d63c5a86..7579304c8cb 100644
--- a/docproc/src/main/java/com/yahoo/docproc/Processing.java
+++ b/docproc/src/main/java/com/yahoo/docproc/Processing.java
@@ -1,7 +1,8 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.docproc;
-import com.yahoo.component.provider.ComponentRegistry;
+import com.yahoo.docproc.impl.ProcessingAccess;
+import com.yahoo.docproc.impl.ProcessingEndpoint;
import com.yahoo.document.DocumentOperation;
import java.util.ArrayList;
@@ -18,7 +19,7 @@ import java.util.Map;
*
* @author bratseth
*/
-public class Processing {
+public class Processing extends ProcessingAccess {
/** The name of the service which owns this processing. Null is the same as "default". */
private String service = null;
@@ -40,13 +41,8 @@ public class Processing {
private Map<String, Object> context = null;
/** The endpoint of this processing. */
- @SuppressWarnings("removal") // TODO Vespa 8: remove
private ProcessingEndpoint endpoint = null;
- /** The registry of docproc services. */
- @SuppressWarnings("removal") // TODO Vespa 8: remove
- private ComponentRegistry<DocprocService> docprocServiceRegistry = null;
-
private boolean operationsGotten = false;
/**
@@ -79,8 +75,7 @@ public class Processing {
* @param callStack the document processors to call in this processing.
* @param endp the endpoint of this processing
*/
- @SuppressWarnings("removal") // TODO Vespa 8: remove
- Processing(String service, DocumentOperation documentOperation, CallStack callStack, ProcessingEndpoint endp) {
+ private Processing(String service, DocumentOperation documentOperation, CallStack callStack, ProcessingEndpoint endp) {
this.service = service;
this.documentOperations = new ArrayList<>(1);
documentOperations.add(documentOperation);
@@ -102,9 +97,8 @@ public class Processing {
this(service, documentOperation, callStack, null);
}
- // TODO Vespa 8: remove "removal"
- @SuppressWarnings({"unused", "removal"})
- private Processing(String service, List<DocumentOperation> documentOpsAndUpdates, CallStack callStack, ProcessingEndpoint endp, boolean unused) {
+ @SuppressWarnings({"unused"})
+ protected Processing(String service, List<DocumentOperation> documentOpsAndUpdates, CallStack callStack, ProcessingEndpoint endp, boolean unused) {
this.service = service;
this.documentOperations = new ArrayList<>(documentOpsAndUpdates.size());
documentOperations.addAll(documentOpsAndUpdates);
@@ -112,11 +106,6 @@ public class Processing {
this.endpoint = endp;
}
- @SuppressWarnings("removal") // TODO Vespa 8: remove
- static Processing createProcessingFromDocumentOperations(String service, List<DocumentOperation> documentOpsAndUpdates, CallStack callStack, ProcessingEndpoint endp) {
- return new Processing(service, documentOpsAndUpdates, callStack, endp, false);
- }
-
/**
* Creates a Processing from a list of operations.
*
@@ -133,21 +122,6 @@ public class Processing {
return new Processing(service, documentsAndUpdates, callStack, null, false);
}
- @Deprecated(forRemoval = true, since="7")
- @SuppressWarnings("removal") // TODO Vespa 8: remove
- public ComponentRegistry<DocprocService> getDocprocServiceRegistry() {
- return docprocServiceRegistry;
- }
-
- /**
- * @deprecated This method will be removed without replacement in Vespa 8.
- */
- @Deprecated(forRemoval = true, since="7")
- @SuppressWarnings("removal") // TODO Vespa 8: remove
- public void setDocprocServiceRegistry(ComponentRegistry<DocprocService> docprocServiceRegistry) {
- this.docprocServiceRegistry = docprocServiceRegistry;
- }
-
/** Returns the name of the service processing this. This will never return null */
public String getServiceName() {
if (service == null) return "default";
@@ -159,23 +133,6 @@ public class Processing {
this.service = service;
}
- /**
- * Convenience method for looking up and returning the service processing this. This might return null
- * if #getServiceName returns a name that is not registered in {@link com.yahoo.docproc.DocprocService}.
- *
- * @return the service processing this, or null if unknown.
- * @deprecated Formerly used to retrieve the {@link com.yahoo.document.DocumentTypeManager},
- * which can now be directly injected via your component constructor.
- */
- @Deprecated(forRemoval = true, since="7")
- @SuppressWarnings("removal") // TODO Vespa 8: remove
- public DocprocService getService() {
- if (docprocServiceRegistry != null) {
- return docprocServiceRegistry.getComponent(getServiceName());
- }
- return null;
- }
-
/** Returns a context variable, or null if it is not set */
public Object getVariable(String name) {
if (context == null) return null;
@@ -214,23 +171,13 @@ public class Processing {
return context != null && context.containsKey(name);
}
- /**
- * Returns the ProcessingEndpoint that is called when this Processing is complete, if any.
- *
- * @return the ProcessingEndpoint, or null
- */
- @SuppressWarnings("removal") // TODO Vespa 8: remove
- ProcessingEndpoint getEndpoint() {
+ @Override
+ protected ProcessingEndpoint getEndpoint() {
return endpoint;
}
- /**
- * Sets the ProcessingEndpoint to be called when this Processing is complete.
- *
- * @param endpoint the ProcessingEndpoint to use
- */
- @SuppressWarnings("removal") // TODO Vespa 8: remove
- void setEndpoint(ProcessingEndpoint endpoint) {
+ @Override
+ protected void setEndpoint(ProcessingEndpoint endpoint) {
this.endpoint = endpoint;
}
@@ -256,17 +203,13 @@ public class Processing {
return callStack;
}
- /**
- * Package-private method to set the callstack of this processing. Only to be used
- * by DocprocService.process(Processing).
- *
- * @param callStack the callstack to set
- */
- void setCallStack(CallStack callStack) {
+ @Override
+ protected void setCallStack(CallStack callStack) {
this.callStack = callStack;
}
- List<DocumentOperation> getOnceOperationsToBeProcessed() {
+ @Override
+ protected List<DocumentOperation> getOnceOperationsToBeProcessed() {
if (operationsGotten)
return Collections.emptyList();