public final class UpdateRequestProcessorChain extends Object implements PluginInfoInitialized
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:
default="true"
(see example above)
Allmost 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()
.
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
log |
Constructor and Description |
---|
UpdateRequestProcessorChain(SolrCore solrCore) |
UpdateRequestProcessorChain(UpdateRequestProcessorFactory[] chain,
SolrCore solrCore)
Creates a chain backed directly by the specified array.
|
Modifier and Type | Method and Description |
---|---|
UpdateRequestProcessor |
createProcessor(SolrQueryRequest req,
SolrQueryResponse rsp)
Uses the factories in this chain to creates a new
UpdateRequestProcessor instance specific for this request. |
UpdateRequestProcessorFactory[] |
getFactories()
Returns the underlying array of factories used in this chain.
|
void |
init(PluginInfo info)
Initializes the chain using the factories specified by the
PluginInfo . |
public UpdateRequestProcessorChain(SolrCore solrCore)
public UpdateRequestProcessorChain(UpdateRequestProcessorFactory[] chain, SolrCore solrCore)
createProcessor
public void init(PluginInfo info)
PluginInfo
.
if the chain includes the RunUpdateProcessorFactory
, but
does not include an implementation of the
DistributingUpdateProcessorFactory
interface, then an
instance of DistributedUpdateProcessorFactory
will be
injected immediately prior to the RunUpdateProcessorFactory
.init
in interface PluginInfoInitialized
DistributingUpdateProcessorFactory
,
RunUpdateProcessorFactory
,
DistributedUpdateProcessorFactory
public UpdateRequestProcessor createProcessor(SolrQueryRequest req, SolrQueryResponse rsp)
UpdateRequestProcessor
instance specific for this request.
If the DISTRIB_UPDATE_PARAM
is present in the request and is
non-blank, then any factory in this chain prior to the instance of
DistributingUpdateProcessorFactory
will be skipped,
except for the log update processor factory.public UpdateRequestProcessorFactory[] getFactories()
createProcessor
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.