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 class
DistributedUpdateProcessor.DistribPhase
Values this processor supports for theDISTRIB_UPDATE_PARAM
.static class
DistributedUpdateProcessor.DistributedUpdatesAsyncException
static class
DistributedUpdateProcessor.LeaderRequestReplicationTracker
static class
DistributedUpdateProcessor.RollupRequestReplicationTracker
-
Field Summary
Fields Modifier and Type Field Description static String
COMMIT_END_POINT
static String
DISTRIB_FROM
static String
DISTRIB_FROM_COLLECTION
static String
DISTRIB_FROM_PARENT
static String
DISTRIB_FROM_SHARD
static String
DISTRIB_INPLACE_PREVVERSION
static String
LOG_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 int
bucketHash(org.apache.lucene.util.BytesRef idBytes)
protected void
doClose()
Override to implement resource release logic that *must* be called at the end of a request.void
doDeleteByQuery(DeleteUpdateCommand cmd)
protected ModifiableSolrParams
filterParams(SolrParams params)
void
finish()
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.void
processAdd(AddUpdateCommand cmd)
void
processCommit(CommitUpdateCommand cmd)
void
processDelete(DeleteUpdateCommand cmd)
protected boolean
versionAdd(AddUpdateCommand cmd)
protected boolean
versionDelete(DeleteUpdateCommand cmd)
protected void
versionDeleteByQuery(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:
processAdd
in classUpdateRequestProcessor
- Throws:
IOException
-
doClose
protected void doClose()
Description copied from class:UpdateRequestProcessor
Override to implement resource release logic that *must* be called at the end of a request.- Overrides:
doClose
in 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:
processDelete
in 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:
processCommit
in classUpdateRequestProcessor
- Throws:
IOException
-
finish
public void finish() throws IOException
- Overrides:
finish
in 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)
-
-