This is an automated email from the ASF dual-hosted git repository.

cpoerschke 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 e668dceb6be SOLR-17686: Rename SearchHandler.stageInEnglish to 
stageToString and make it protected and non-static (#3224)
e668dceb6be is described below

commit e668dceb6bec0b838d5f1e045483432abd6b6612
Author: Jeanie Lam <[email protected]>
AuthorDate: Mon Mar 3 14:35:21 2025 +0000

    SOLR-17686: Rename SearchHandler.stageInEnglish to stageToString and make 
it protected and non-static (#3224)
---
 .../java/org/apache/solr/handler/component/SearchHandler.java | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git 
a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java 
b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
index 2d6b36ac3cb..45a8c1d7a19 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
@@ -662,7 +662,7 @@ public class SearchHandler extends RequestHandlerBase
             for (SearchComponent c : components) {
               if (checkLimitsBefore(
                   c,
-                  "handleResponses next stage:" + stageInEnglish(nextStage),
+                  "handleResponses next stage:" + stageToString(nextStage),
                   rb.req,
                   rb.rsp,
                   components)) {
@@ -681,7 +681,7 @@ public class SearchHandler extends RequestHandlerBase
 
         for (SearchComponent c : components) {
           if (checkLimitsBefore(
-              c, "finishStage stage:" + stageInEnglish(nextStage), rb.req, 
rb.rsp, components)) {
+              c, "finishStage stage:" + stageToString(nextStage), rb.req, 
rb.rsp, components)) {
             return;
           }
           c.finishStage(rb);
@@ -726,9 +726,9 @@ public class SearchHandler extends RequestHandlerBase
     return true;
   }
 
-  private static String stageInEnglish(int nextStage) {
+  protected String stageToString(int stage) {
     // This should probably be a enum, but that change should be its own 
ticket.
-    switch (nextStage) {
+    switch (stage) {
       case STAGE_START:
         return "START";
       case STAGE_PARSE_QUERY:
@@ -743,8 +743,7 @@ public class SearchHandler extends RequestHandlerBase
       case STAGE_DONE:
         return "FINISHING";
       default:
-        throw new SolrException(
-            SolrException.ErrorCode.SERVER_ERROR, "Unrecognized stage:" + 
nextStage);
+        return "CUSTOM_STAGE_" + String.valueOf(stage);
     }
   }
 

Reply via email to