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:
DistributedZkUpdateProcessor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumValues this processor supports for theDISTRIB_UPDATE_PARAM.static final classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected booleanprotected booleanprotected booleanprotected booleanstatic final Stringprotected final intNumber of times requests forwarded to some other shard's leader can be retriedprotected final intNumber of times requests from leaders to followers can be retriedprotected final org.apache.solr.common.cloud.Replica.Typeprotected final SolrQueryRequestprotected final SolrQueryResponseprotected static final StringFields inherited from class org.apache.solr.update.processor.UpdateRequestProcessor
next -
Constructor Summary
ConstructorsConstructorDescriptionDistributedUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, AtomicUpdateDocumentMerger docMerger, UpdateRequestProcessor next) Specification of AtomicUpdateDocumentMerger is currently experimental.DistributedUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.solr.common.cloud.Replica.Typeprotected voidprotected voidfor implementing classes to setup request data(nodes, replicas)protected voiddoDeleteByQuery(DeleteUpdateCommand cmd, List<SolrCmdDistributor.Node> replicas, org.apache.solr.common.cloud.DocCollection coll) should be called by implementing class after setting up replicasprotected voidprotected voidThis method can be overridden to tamper with the cmd after the localDeleteById operationprotected voiddoDistribDeleteByQuery(DeleteUpdateCommand cmd, List<SolrCmdDistributor.Node> replicas, org.apache.solr.common.cloud.DocCollection coll) This runs after versionDeleteByQuery is invoked, should be used to tamper or forward DeleteCommandprotected voidprotected voidprotected org.apache.solr.common.params.ModifiableSolrParamsfilterParams(org.apache.solr.common.params.SolrParams params) final voidfinish()protected StringgetLeaderUrl(String id) static booleanReturns a boolean indicating whether or not the caller should behave as if this is the "leader" even when ZooKeeper is not enabled.protected UpdateLocksvoidvoidvoidprotected booleanprotected booleanprotected booleanprotected voidMethods inherited from class org.apache.solr.update.processor.UpdateRequestProcessor
close, doClose, processMergeIndexes, processRollback
-
Field Details
-
DISTRIB_FROM_SHARD
- See Also:
-
DISTRIB_FROM_COLLECTION
- See Also:
-
DISTRIB_FROM_PARENT
- See Also:
-
DISTRIB_FROM
- See Also:
-
DISTRIB_INPLACE_PREVVERSION
- See Also:
-
TEST_DISTRIB_SKIP_SERVERS
- See Also:
-
COMMIT_END_POINT
- See Also:
-
LOG_REPLAY
- See Also:
-
req
-
rsp
-
isLeader
protected boolean isLeader -
forwardToLeader
protected boolean forwardToLeader -
isSubShardLeader
protected boolean isSubShardLeader -
isIndexChanged
protected boolean isIndexChanged -
maxRetriesOnForward
protected final int maxRetriesOnForwardNumber of times requests forwarded to some other shard's leader can be retried -
maxRetriesToFollowers
protected final int maxRetriesToFollowersNumber of times requests from leaders to followers can be retried -
replicaType
protected final org.apache.solr.common.cloud.Replica.Type replicaType
-
-
Constructor Details
-
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 Details
-
getUpdateLocks
-
computeReplicaType
protected org.apache.solr.common.cloud.Replica.Type computeReplicaType()- Returns:
- the replica type of the collection.
-
processAdd
- Overrides:
processAddin classUpdateRequestProcessor- Throws:
IOException
-
doDistribAdd
- Throws:
IOException
-
versionAdd
- Returns:
- whether or not to drop this cmd
- Throws:
IOException- If there is a low-level I/O error.
-
shouldCloneCmdDoc
protected boolean shouldCloneCmdDoc()- Returns:
- whether cmd doc should be cloned before localAdd
-
processDelete
- Overrides:
processDeletein classUpdateRequestProcessor- Throws:
IOException
-
doDeleteById
- Throws:
IOException
-
doDistribDeleteById
This method can be overridden to tamper with the cmd after the localDeleteById operation- Parameters:
cmd- the delete command- Throws:
IOException- in case post processing failed
-
filterParams
protected org.apache.solr.common.params.ModifiableSolrParams filterParams(org.apache.solr.common.params.SolrParams params) - See Also:
-
doDeleteByQuery
for implementing classes to setup request data(nodes, replicas)- Parameters:
cmd- the delete command being processed- Throws:
IOException
-
doDeleteByQuery
protected void doDeleteByQuery(DeleteUpdateCommand cmd, List<SolrCmdDistributor.Node> replicas, org.apache.solr.common.cloud.DocCollection coll) throws IOException should be called by implementing class after setting up replicas- Parameters:
cmd- delete commandreplicas- list of Nodes replicas to pass todoDistribDeleteByQuery(DeleteUpdateCommand, List, DocCollection)coll- the collection in zookeeperDocCollection, passed todoDistribDeleteByQuery(DeleteUpdateCommand, List, DocCollection)- Throws:
IOException
-
doDistribDeleteByQuery
protected void doDistribDeleteByQuery(DeleteUpdateCommand cmd, List<SolrCmdDistributor.Node> replicas, org.apache.solr.common.cloud.DocCollection coll) throws IOException This runs after versionDeleteByQuery is invoked, should be used to tamper or forward DeleteCommand- Parameters:
cmd- delete commandreplicas- list of Nodes replicascoll- the collection in zookeeperDocCollection.- Throws:
IOException- in case post processing failed
-
versionDeleteByQuery
- Throws:
IOException
-
getLeaderUrl
- Parameters:
id- id of doc- Returns:
- url of leader, or null if not found.
-
versionDelete
- Throws:
IOException
-
processCommit
- Overrides:
processCommitin classUpdateRequestProcessor- Throws:
IOException
-
doLocalCommit
- Throws:
IOException
-
finish
- Overrides:
finishin classUpdateRequestProcessor- Throws:
IOException
-
doDistribFinish
- Throws:
IOException
-
getNonZkLeaderAssumption
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)
-