Package org.apache.solr.update.processor
Class DistributedUpdateProcessor
- java.lang.Object
-
- org.apache.solr.update.processor.UpdateRequestProcessor
-
- org.apache.solr.update.processor.DistributedUpdateProcessor
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
CdcrUpdateProcessor
public class DistributedUpdateProcessor extends UpdateRequestProcessor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDistributedUpdateProcessor.DistribPhaseValues this processor supports for theDISTRIB_UPDATE_PARAM.static classDistributedUpdateProcessor.DistributedUpdatesAsyncExceptionstatic classDistributedUpdateProcessor.LeaderRequestReplicationTrackerstatic classDistributedUpdateProcessor.RollupRequestReplicationTracker
-
Field Summary
Fields Modifier and Type Field Description static StringCOMMIT_END_POINTstatic StringDISTRIB_FROMstatic StringDISTRIB_FROM_COLLECTIONstatic StringDISTRIB_FROM_PARENTstatic StringDISTRIB_FROM_SHARDstatic StringDISTRIB_INPLACE_PREVVERSIONstatic StringLOG_REPLAY
-
Constructor Summary
Constructors Constructor Description DistributedUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, AtomicUpdateDocumentMerger docMerger, UpdateRequestProcessor next)Specification of AtomicUpdateDocumentMerger is currently experimental.DistributedUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intbucketHash(org.apache.lucene.util.BytesRef idBytes)protected voiddoClose()Override to implement resource release logic that *must* be called at the end of a request.voiddoDeleteByQuery(DeleteUpdateCommand cmd)protected ModifiableSolrParamsfilterParams(SolrParams params)voidfinish()static booleangetNonZkLeaderAssumption(SolrQueryRequest req)Returns a boolean indicating whether or not the caller should behave as if this is the "leader" even when ZooKeeper is not enabled.voidprocessAdd(AddUpdateCommand cmd)voidprocessCommit(CommitUpdateCommand cmd)voidprocessDelete(DeleteUpdateCommand cmd)protected booleanversionAdd(AddUpdateCommand cmd)protected booleanversionDelete(DeleteUpdateCommand cmd)protected voidversionDeleteByQuery(DeleteUpdateCommand cmd)-
Methods inherited from class org.apache.solr.update.processor.UpdateRequestProcessor
close, processMergeIndexes, processRollback
-
-
-
-
Field Detail
-
DISTRIB_FROM_SHARD
public static final String DISTRIB_FROM_SHARD
- See Also:
- Constant Field Values
-
DISTRIB_FROM_COLLECTION
public static final String DISTRIB_FROM_COLLECTION
- See Also:
- Constant Field Values
-
DISTRIB_FROM_PARENT
public static final String DISTRIB_FROM_PARENT
- See Also:
- Constant Field Values
-
DISTRIB_FROM
public static final String DISTRIB_FROM
- See Also:
- Constant Field Values
-
DISTRIB_INPLACE_PREVVERSION
public static final String DISTRIB_INPLACE_PREVVERSION
- See Also:
- Constant Field Values
-
COMMIT_END_POINT
public static final String COMMIT_END_POINT
- See Also:
- Constant Field Values
-
LOG_REPLAY
public static final String LOG_REPLAY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DistributedUpdateProcessor
public DistributedUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)
-
DistributedUpdateProcessor
public DistributedUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, AtomicUpdateDocumentMerger docMerger, UpdateRequestProcessor next)
Specification of AtomicUpdateDocumentMerger is currently experimental.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Method Detail
-
processAdd
public void processAdd(AddUpdateCommand cmd) throws IOException
- Overrides:
processAddin classUpdateRequestProcessor- Throws:
IOException
-
doClose
protected void doClose()
Description copied from class:UpdateRequestProcessorOverride to implement resource release logic that *must* be called at the end of a request.- Overrides:
doClosein classUpdateRequestProcessor
-
bucketHash
public static int bucketHash(org.apache.lucene.util.BytesRef idBytes)
-
versionAdd
protected boolean versionAdd(AddUpdateCommand cmd) throws IOException
- Returns:
- whether or not to drop this cmd
- Throws:
IOException- If there is a low-level I/O error.
-
processDelete
public void processDelete(DeleteUpdateCommand cmd) throws IOException
- Overrides:
processDeletein classUpdateRequestProcessor- Throws:
IOException
-
filterParams
protected ModifiableSolrParams filterParams(SolrParams params)
-
doDeleteByQuery
public void doDeleteByQuery(DeleteUpdateCommand cmd) throws IOException
- Throws:
IOException
-
versionDeleteByQuery
protected void versionDeleteByQuery(DeleteUpdateCommand cmd) throws IOException
- Throws:
IOException
-
versionDelete
protected boolean versionDelete(DeleteUpdateCommand cmd) throws IOException
- Throws:
IOException
-
processCommit
public void processCommit(CommitUpdateCommand cmd) throws IOException
- Overrides:
processCommitin classUpdateRequestProcessor- Throws:
IOException
-
finish
public void finish() throws IOException- Overrides:
finishin classUpdateRequestProcessor- Throws:
IOException
-
getNonZkLeaderAssumption
public static boolean getNonZkLeaderAssumption(SolrQueryRequest req)
Returns a boolean indicating whether or not the caller should behave as if this is the "leader" even when ZooKeeper is not enabled. (Even in non zk mode, tests may simulate updates to/from a leader)
-
-