Package org.apache.solr.update.processor
Class UpdateRequestProcessorChain
- java.lang.Object
-
- org.apache.solr.update.processor.UpdateRequestProcessorChain
-
- All Implemented Interfaces:
PluginInfoInitialized
public final class UpdateRequestProcessorChain extends Object implements PluginInfoInitialized
Manages a chain of UpdateRequestProcessorFactories.Chains can be configured via solrconfig.xml using the following syntax...
<updateRequestProcessorChain name="key" default="true"> <processor class="package.Class1" /> <processor class="package.Class2" > <str name="someInitParam1">value</str> <int name="someInitParam2">42</int> </processor> <processor class="solr.LogUpdateProcessorFactory" > <int name="maxNumToLog">100</int> </processor> <processor class="solr.RunUpdateProcessorFactory" /> </updateRequestProcessorChain>
Multiple Chains can be defined, each with a distinct name. The name of a chain used to handle an update request may be specified using the request param
update.chain
. If no chain is explicitly selected by name, then Solr will attempt to determine a default chain:- A single configured chain may explicitly be declared with
default="true"
(see example above) - If no chain is explicitly declared as the default, Solr will look for any chain that does not have a name, and treat it as the default
- As a last resort, Solr will create an implicit default chain consisting of:
Almost all processor chains should end with an instance of
RunUpdateProcessorFactory
unless the user is explicitly executing the update commands in an alternative customUpdateRequestProcessorFactory
. If a chain includesRunUpdateProcessorFactory
but does not include aDistributingUpdateProcessorFactory
, it will be added automatically byinit()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UpdateRequestProcessorChain.LazyUpdateProcessorFactoryHolder
static class
UpdateRequestProcessorChain.ProcessorInfo
-
Field Summary
Fields Modifier and Type Field Description static Map<String,Class<? extends UpdateRequestProcessorFactory>>
implicits
-
Constructor Summary
Constructors Constructor Description UpdateRequestProcessorChain(List<UpdateRequestProcessorFactory> chain, SolrCore solrCore)
Creates a chain backed directly by the specified list.UpdateRequestProcessorChain(SolrCore solrCore)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UpdateRequestProcessorChain
constructChain(UpdateRequestProcessorChain defaultUrp, UpdateRequestProcessorChain.ProcessorInfo processorInfo, SolrCore core)
UpdateRequestProcessor
createProcessor(SolrQueryRequest req, SolrQueryResponse rsp)
Uses the factories in this chain to creates a newUpdateRequestProcessor
instance specific for this request.UpdateRequestProcessor
createProcessor(SolrQueryRequest req, SolrQueryResponse rsp, boolean skipToDistrib, UpdateRequestProcessor last)
List<UpdateRequestProcessorFactory>
getProcessors()
Returns the underlying array of factories used in this chain.void
init(PluginInfo info)
Initializes the chain using the factories specified by thePluginInfo
.
-
-
-
Field Detail
-
implicits
public static final Map<String,Class<? extends UpdateRequestProcessorFactory>> implicits
-
-
Constructor Detail
-
UpdateRequestProcessorChain
public UpdateRequestProcessorChain(SolrCore solrCore)
-
UpdateRequestProcessorChain
public UpdateRequestProcessorChain(List<UpdateRequestProcessorFactory> chain, SolrCore solrCore)
Creates a chain backed directly by the specified list. Modifications to the array will affect future calls tocreateProcessor
-
-
Method Detail
-
init
public void init(PluginInfo info)
Initializes the chain using the factories specified by thePluginInfo
. if the chain includes theRunUpdateProcessorFactory
, but does not include an implementation of theDistributingUpdateProcessorFactory
interface, then an instance ofDistributedUpdateProcessorFactory
will be injected immediately prior to theRunUpdateProcessorFactory
.- Specified by:
init
in interfacePluginInfoInitialized
- See Also:
DistributingUpdateProcessorFactory
,RunUpdateProcessorFactory
,DistributedUpdateProcessorFactory
-
createProcessor
public UpdateRequestProcessor createProcessor(SolrQueryRequest req, SolrQueryResponse rsp)
Uses the factories in this chain to creates a newUpdateRequestProcessor
instance specific for this request. If theDISTRIB_UPDATE_PARAM
is present in the request and is non-blank, then any factory in this chain prior to the instance ofDistributingUpdateProcessorFactory
-
createProcessor
public UpdateRequestProcessor createProcessor(SolrQueryRequest req, SolrQueryResponse rsp, boolean skipToDistrib, UpdateRequestProcessor last)
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
getProcessors
public List<UpdateRequestProcessorFactory> getProcessors()
Returns the underlying array of factories used in this chain. Modifications to the array will affect future calls tocreateProcessor
-
constructChain
public static UpdateRequestProcessorChain constructChain(UpdateRequestProcessorChain defaultUrp, UpdateRequestProcessorChain.ProcessorInfo processorInfo, SolrCore core)
-
-