Package org.apache.solr.update.processor
Class DistributedZkUpdateProcessor
java.lang.Object
org.apache.solr.update.processor.UpdateRequestProcessor
org.apache.solr.update.processor.DistributedUpdateProcessor
org.apache.solr.update.processor.DistributedZkUpdateProcessor
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.update.processor.DistributedUpdateProcessor
DistributedUpdateProcessor.DistribPhase, DistributedUpdateProcessor.DistributedUpdatesAsyncException, DistributedUpdateProcessor.LeaderRequestReplicationTracker, DistributedUpdateProcessor.RollupRequestReplicationTracker -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.solr.common.cloud.ClusterStateprotected List<SolrCmdDistributor.Node> Fields inherited from class org.apache.solr.update.processor.DistributedUpdateProcessor
COMMIT_END_POINT, DISTRIB_FROM, DISTRIB_FROM_COLLECTION, DISTRIB_FROM_PARENT, DISTRIB_FROM_SHARD, DISTRIB_INPLACE_PREVVERSION, forwardToLeader, isIndexChanged, isLeader, isSubShardLeader, LOG_REPLAY, maxRetriesOnForward, maxRetriesToFollowers, replicaType, req, rsp, TEST_DISTRIB_SKIP_SERVERSFields inherited from class org.apache.solr.update.processor.UpdateRequestProcessor
next -
Constructor Summary
ConstructorsConstructorDescriptionDistributedZkUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanamISubShardLeader(org.apache.solr.common.cloud.DocCollection coll, org.apache.solr.common.cloud.Slice parentSlice, String id, org.apache.solr.common.SolrInputDocument doc) ForCollectionParams.CollectionAction.SPLITSHARDprotected org.apache.solr.common.cloud.Replica.Typeprotected voiddoClose()Override to implement resource release logic that *must* be called at the end of a request.protected voidprotected voidfor implementing classes to setup request data(nodes, replicas)protected 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 StringgetLeaderUrl(String id) protected List<SolrCmdDistributor.Node> getNodesByRoutingRules(org.apache.solr.common.cloud.ClusterState cstate, org.apache.solr.common.cloud.DocCollection coll, String id, org.apache.solr.common.SolrInputDocument doc) ForCollectionParams.CollectionAction.MIGRATEprotected List<SolrCmdDistributor.Node> getReplicaNodesForLeader(String shardId, org.apache.solr.common.cloud.Replica leaderReplica, int maxRetries) protected List<SolrCmdDistributor.Node> getSubShardLeaders(org.apache.solr.common.cloud.DocCollection coll, String shardId, String docId, org.apache.solr.common.SolrInputDocument doc) ForCollectionParams.CollectionAction.SPLITSHARDvoidvoidvoidvoidvoidprotected List<SolrCmdDistributor.Node> setupRequest(String id, org.apache.solr.common.SolrInputDocument doc, String route, UpdateCommand updateCommand) protected booleanMethods inherited from class org.apache.solr.update.processor.DistributedUpdateProcessor
doDeleteByQuery, doLocalCommit, filterParams, finish, getNonZkLeaderAssumption, getUpdateLocks, versionAdd, versionDelete, versionDeleteByQueryMethods inherited from class org.apache.solr.update.processor.UpdateRequestProcessor
close
-
Field Details
-
nodes
-
clusterState
protected org.apache.solr.common.cloud.ClusterState clusterState
-
-
Constructor Details
-
DistributedZkUpdateProcessor
public DistributedZkUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)
-
-
Method Details
-
computeReplicaType
protected org.apache.solr.common.cloud.Replica.Type computeReplicaType()- Overrides:
computeReplicaTypein classDistributedUpdateProcessor- Returns:
- the replica type of the collection.
-
processCommit
- Overrides:
processCommitin classDistributedUpdateProcessor- Throws:
IOException
-
processAdd
- Overrides:
processAddin classDistributedUpdateProcessor- Throws:
IOException
-
doDistribAdd
- Overrides:
doDistribAddin classDistributedUpdateProcessor- Throws:
IOException
-
processDelete
- Overrides:
processDeletein classDistributedUpdateProcessor- Throws:
IOException
-
doDeleteById
- Overrides:
doDeleteByIdin classDistributedUpdateProcessor- Throws:
IOException
-
doDistribDeleteById
Description copied from class:DistributedUpdateProcessorThis method can be overridden to tamper with the cmd after the localDeleteById operation- Overrides:
doDistribDeleteByIdin classDistributedUpdateProcessor- Parameters:
cmd- the delete command- Throws:
IOException- in case post processing failed
-
doDeleteByQuery
Description copied from class:DistributedUpdateProcessorfor implementing classes to setup request data(nodes, replicas)- Overrides:
doDeleteByQueryin classDistributedUpdateProcessor- Parameters:
cmd- the delete command being processed- Throws:
IOException
-
doDistribDeleteByQuery
protected void doDistribDeleteByQuery(DeleteUpdateCommand cmd, List<SolrCmdDistributor.Node> replicas, org.apache.solr.common.cloud.DocCollection coll) throws IOException Description copied from class:DistributedUpdateProcessorThis runs after versionDeleteByQuery is invoked, should be used to tamper or forward DeleteCommand- Overrides:
doDistribDeleteByQueryin classDistributedUpdateProcessor- Parameters:
cmd- delete commandreplicas- list of Nodes replicascoll- the collection in zookeeperDocCollection.- Throws:
IOException- in case post processing failed
-
getLeaderUrl
- Overrides:
getLeaderUrlin classDistributedUpdateProcessor- Parameters:
id- id of doc- Returns:
- url of leader, or null if not found.
-
setupRequest
protected List<SolrCmdDistributor.Node> setupRequest(String id, org.apache.solr.common.SolrInputDocument doc, String route, UpdateCommand updateCommand) -
shouldCloneCmdDoc
protected boolean shouldCloneCmdDoc()- Overrides:
shouldCloneCmdDocin classDistributedUpdateProcessor- Returns:
- whether cmd doc should be cloned before localAdd
-
amISubShardLeader
protected boolean amISubShardLeader(org.apache.solr.common.cloud.DocCollection coll, org.apache.solr.common.cloud.Slice parentSlice, String id, org.apache.solr.common.SolrInputDocument doc) throws InterruptedException ForCollectionParams.CollectionAction.SPLITSHARD- Throws:
InterruptedException
-
getReplicaNodesForLeader
protected List<SolrCmdDistributor.Node> getReplicaNodesForLeader(String shardId, org.apache.solr.common.cloud.Replica leaderReplica, int maxRetries) -
getSubShardLeaders
protected List<SolrCmdDistributor.Node> getSubShardLeaders(org.apache.solr.common.cloud.DocCollection coll, String shardId, String docId, org.apache.solr.common.SolrInputDocument doc) ForCollectionParams.CollectionAction.SPLITSHARD -
getNodesByRoutingRules
protected List<SolrCmdDistributor.Node> getNodesByRoutingRules(org.apache.solr.common.cloud.ClusterState cstate, org.apache.solr.common.cloud.DocCollection coll, String id, org.apache.solr.common.SolrInputDocument doc) ForCollectionParams.CollectionAction.MIGRATE -
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
-
processMergeIndexes
- Overrides:
processMergeIndexesin classUpdateRequestProcessor- Throws:
IOException
-
processRollback
- Overrides:
processRollbackin classUpdateRequestProcessor- Throws:
IOException
-
doDistribFinish
protected void doDistribFinish()- Overrides:
doDistribFinishin classDistributedUpdateProcessor
-