Package org.apache.solr.update.processor
Class UpdateRequestProcessorChain
java.lang.Object
org.apache.solr.update.processor.UpdateRequestProcessorChain
- All Implemented Interfaces:
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 custom
UpdateRequestProcessorFactory. If a chain includes RunUpdateProcessorFactory
but does not include a DistributingUpdateProcessorFactory, it will be added
automatically by init().
- Since:
- solr 1.3
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map<String, Class<? extends UpdateRequestProcessorFactory>> -
Constructor Summary
ConstructorsConstructorDescriptionUpdateRequestProcessorChain(List<UpdateRequestProcessorFactory> chain, SolrCore solrCore) Creates a chain backed directly by the specified list.UpdateRequestProcessorChain(SolrCore solrCore) -
Method Summary
Modifier and TypeMethodDescriptionstatic UpdateRequestProcessorChainconstructChain(UpdateRequestProcessorChain defaultUrp, UpdateRequestProcessorChain.ProcessorInfo processorInfo, SolrCore core) createProcessor(SolrQueryRequest req, SolrQueryResponse rsp) Uses the factories in this chain to creates a newUpdateRequestProcessorinstance specific for this request.createProcessor(SolrQueryRequest req, SolrQueryResponse rsp, boolean skipToDistrib, UpdateRequestProcessor last) Returns the underlying array of factories used in this chain.voidinit(PluginInfo info) Initializes the chain using the factories specified by thePluginInfo.
-
Field Details
-
implicits
-
-
Constructor Details
-
UpdateRequestProcessorChain
-
UpdateRequestProcessorChain
Creates a chain backed directly by the specified list. Modifications to the array will affect future calls tocreateProcessor
-
-
Method Details
-
init
Initializes the chain using the factories specified by thePluginInfo. if the chain includes theRunUpdateProcessorFactory, but does not include an implementation of theDistributingUpdateProcessorFactoryinterface, then an instance ofDistributedUpdateProcessorFactorywill be injected immediately prior to theRunUpdateProcessorFactory.- Specified by:
initin interfacePluginInfoInitialized- See Also:
-
createProcessor
Uses the factories in this chain to creates a newUpdateRequestProcessorinstance specific for this request. If theDISTRIB_UPDATE_PARAMis present in the request and is non-blank, then any factory in this chain prior to the instance ofwill be skipped, except for the log update processor factory.DistributingUpdateProcessorFactory- See Also:
-
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
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)
-