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 maxErrors
errors (or unlimited
if -1==maxErrors
) are logged and recorded the batch continues.
The client will receive a status==200
response, which includes a list of errors
that were tolerated.
If more then maxErrors
occur, the first exception recorded will be re-thrown,
Solr will respond with status==5xx
or status==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.FROMLEADER
requests (because any successes that occur locally on the leader are considered successes even if there is some
subsequent error on a replica). TolerantUpdateProcessorFactory
will short circut it away in those
requests.
TolerantUpdateProcessorFactory
next
Constructor and Description |
---|
TolerantUpdateProcessor(SolrQueryRequest req,
SolrQueryResponse rsp,
UpdateRequestProcessor next,
int maxErrors,
DistributedUpdateProcessor.DistribPhase distribPhase) |
Modifier and Type | Method and Description |
---|---|
void |
finish() |
void |
processAdd(AddUpdateCommand cmd) |
void |
processCommit(CommitUpdateCommand cmd) |
void |
processDelete(DeleteUpdateCommand cmd) |
void |
processMergeIndexes(MergeIndexesCommand cmd) |
void |
processRollback(RollbackUpdateCommand cmd) |
close, doClose
public TolerantUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next, int maxErrors, DistributedUpdateProcessor.DistribPhase distribPhase)
public void processAdd(AddUpdateCommand cmd) throws IOException
processAdd
in class UpdateRequestProcessor
IOException
public void processDelete(DeleteUpdateCommand cmd) throws IOException
processDelete
in class UpdateRequestProcessor
IOException
public void processMergeIndexes(MergeIndexesCommand cmd) throws IOException
processMergeIndexes
in class UpdateRequestProcessor
IOException
public void processCommit(CommitUpdateCommand cmd) throws IOException
processCommit
in class UpdateRequestProcessor
IOException
public void processRollback(RollbackUpdateCommand cmd) throws IOException
processRollback
in class UpdateRequestProcessor
IOException
public void finish() throws IOException
finish
in class UpdateRequestProcessor
IOException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.