Class TolerantUpdateProcessor
- java.lang.Object
-
- org.apache.solr.update.processor.UpdateRequestProcessor
-
- org.apache.solr.update.processor.TolerantUpdateProcessor
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class TolerantUpdateProcessor extends UpdateRequestProcessor
Suppresses errors for individual add/delete commands within a single request. Instead of failing on the first error, at most
maxErrorserrors (or unlimited if-1==maxErrors) are logged and recorded the batch continues. The client will receive astatus==200response, which includes a list of errors that were tolerated.If more then
maxErrorsoccur, the first exception recorded will be re-thrown, Solr will respond withstatus==5xxorstatus==4xx(depending on the underlying exceptions) and it won't finish processing any more updates in the request. (ie: subsequent update commands in the request will not be processed even if they are valid).NOTE: In cloud based collections, this processor expects to NOT be used on
DistributedUpdateProcessor.DistribPhase.FROMLEADERrequests (because any successes that occur locally on the leader are considered successes even if there is some subsequent error on a replica).TolerantUpdateProcessorFactorywill short circut it away in those requests.- See Also:
TolerantUpdateProcessorFactory
-
-
Field Summary
-
Fields inherited from class org.apache.solr.update.processor.UpdateRequestProcessor
next
-
-
Constructor Summary
Constructors Constructor Description TolerantUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next, int maxErrors, DistributedUpdateProcessor.DistribPhase distribPhase)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinish()voidprocessAdd(AddUpdateCommand cmd)voidprocessCommit(CommitUpdateCommand cmd)voidprocessDelete(DeleteUpdateCommand cmd)voidprocessMergeIndexes(MergeIndexesCommand cmd)voidprocessRollback(RollbackUpdateCommand cmd)-
Methods inherited from class org.apache.solr.update.processor.UpdateRequestProcessor
close, doClose
-
-
-
-
Constructor Detail
-
TolerantUpdateProcessor
public TolerantUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next, int maxErrors, DistributedUpdateProcessor.DistribPhase distribPhase)
-
-
Method Detail
-
processAdd
public void processAdd(AddUpdateCommand cmd) throws IOException
- Overrides:
processAddin classUpdateRequestProcessor- Throws:
IOException
-
processDelete
public void processDelete(DeleteUpdateCommand cmd) throws IOException
- Overrides:
processDeletein classUpdateRequestProcessor- Throws:
IOException
-
processMergeIndexes
public void processMergeIndexes(MergeIndexesCommand cmd) throws IOException
- Overrides:
processMergeIndexesin classUpdateRequestProcessor- Throws:
IOException
-
processCommit
public void processCommit(CommitUpdateCommand cmd) throws IOException
- Overrides:
processCommitin classUpdateRequestProcessor- Throws:
IOException
-
processRollback
public void processRollback(RollbackUpdateCommand cmd) throws IOException
- Overrides:
processRollbackin classUpdateRequestProcessor- Throws:
IOException
-
finish
public void finish() throws IOException- Overrides:
finishin classUpdateRequestProcessor- Throws:
IOException
-
-