aboutsummaryrefslogtreecommitdiffstats
path: root/docproc/src/main/java/com/yahoo/docproc/jdisc/DocumentProcessingHandlerParameters.java
blob: 0f01ffb8ca7fa4461b9e37f9a3907e7a9406c67e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.docproc.jdisc;

import com.yahoo.component.chain.model.ChainsModel;
import com.yahoo.container.core.document.ContainerDocumentConfig;
import com.yahoo.docproc.jdisc.metric.NullMetric;
import com.yahoo.docproc.proxy.SchemaMap;
import com.yahoo.document.DocumentTypeManager;
import com.yahoo.jdisc.Metric;

/**
 * Class to hold parameters given to DocumentProcessingHandler, typically used by unit tests.
 *
 * @author Einar M R Rosenvinge
 * @see com.yahoo.docproc.jdisc.DocumentProcessingHandler
 */
public class DocumentProcessingHandlerParameters {

    private int maxNumThreads = 0;
    private DocumentTypeManager documentTypeManager = null;
    private ChainsModel chainsModel = null;
    private SchemaMap schemaMap = null;
    private Metric metric = new NullMetric();
    private ContainerDocumentConfig containerDocConfig;



    public Metric getMetric() {
        return metric;
    }

    public DocumentProcessingHandlerParameters setMetric(Metric metric) {
        this.metric = metric;
        return this;
    }

    /**
     * Returns the maximum number of thread that the thread pool will ever attempt to run simultaneously.
     *
     * @return the maximum number of thread that the thread pool will ever attempt to run simultaneously.
     */
    public int getMaxNumThreads() {
        return maxNumThreads;
    }

    public DocumentProcessingHandlerParameters setMaxNumThreads(int maxNumThreads) {
        this.maxNumThreads = maxNumThreads;
        return this;
    }

    public DocumentTypeManager getDocumentTypeManager() {
        return documentTypeManager;
    }

    public DocumentProcessingHandlerParameters setDocumentTypeManager(DocumentTypeManager documentTypeManager) {
        this.documentTypeManager = documentTypeManager;
        return this;
    }

    /**
     * Returns the chains model, used to build call stacks.
     * @return the chains model, used to build call stacks.
     */
    public ChainsModel getChainsModel() {
        return chainsModel;
    }

    public DocumentProcessingHandlerParameters setChainsModel(ChainsModel chainsModel) {
        this.chainsModel = chainsModel;
        return this;
    }

    /**
     * Returns the schema map to be used by the docproc handler.
     *
     * @return the schema map to be used by the docproc handler.
     */
    public SchemaMap getSchemaMap() {
        return schemaMap;
    }

    public DocumentProcessingHandlerParameters setSchemaMap(SchemaMap schemaMap) {
        this.schemaMap = schemaMap;
        return this;
    }

    public DocumentProcessingHandlerParameters setContainerDocumentConfig(ContainerDocumentConfig containerDocConfig) {
        this.containerDocConfig = containerDocConfig;
        return this;
    }

    public ContainerDocumentConfig getContainerDocConfig() {
        return containerDocConfig;
    }

}