You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ds...@apache.org on 2026/09/08 15:35:38 UTC
(solr) branch main updated: DistributedUpdateProcessor: expose isLeader, setupRequest (#4878)
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 3e12f16c15e DistributedUpdateProcessor: expose isLeader, setupRequest (#4878)
3e12f16c15e is described below
commit 3e12f16c15ed637fb539214ddb9ce41130c699b2
Author: David Smiley <ds...@apache.org>
AuthorDate: Tue Sep 8 11:35:32 2026 -0400
DistributedUpdateProcessor: expose isLeader, setupRequest (#4878)
---
.../solr/update/processor/DistributedUpdateProcessor.java | 11 +++++++----
.../solr/update/processor/DistributedZkUpdateProcessor.java | 2 +-
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
index 787b3292d42..1126cf60d36 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
@@ -213,7 +213,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
return Replica.Type.NRT;
}
- boolean isLeader() {
+ public boolean isLeader() {
return isLeader;
}
@@ -995,9 +995,12 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
}
}
- // internal helper method to setup request by processors who use this class.
- // NOTE: not called by this class!
- void setupRequest(UpdateCommand cmd) {
+ /**
+ * Set up / initialize. Exposed for other processors to determine {@link #isLeader()} afterward.
+ *
+ * @lucene.internal
+ */
+ public void setupRequest(UpdateCommand cmd) {
isLeader = getNonZkLeaderAssumption(req);
}
diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
index fad45bb70cb..b7fc69e8db3 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
@@ -685,7 +685,7 @@ public class DistributedZkUpdateProcessor extends DistributedUpdateProcessor {
}
@Override
- void setupRequest(UpdateCommand cmd) {
+ public void setupRequest(UpdateCommand cmd) {
zkCheck(cmd);
if (cmd instanceof AddUpdateCommand acmd) {
nodes = setupRequest(acmd.getIndexedIdStr(), acmd.getSolrInputDocument(), null, cmd);