Skip to content

Commit

Permalink
SOLR-17686: Rename SearchHandler.stageInEnglish to stageToString and …
Browse files Browse the repository at this point in the history
…make it protected and non-static (#3224)
  • Loading branch information
jeanielamwh authored Mar 3, 2025
1 parent 046677d commit e668dce
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ private void processComponents(
for (SearchComponent c : components) {
if (checkLimitsBefore(
c,
"handleResponses next stage:" + stageInEnglish(nextStage),
"handleResponses next stage:" + stageToString(nextStage),
rb.req,
rb.rsp,
components)) {
Expand All @@ -681,7 +681,7 @@ private void processComponents(

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);
Expand Down Expand Up @@ -726,9 +726,9 @@ private static boolean prepareComponents(
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:
Expand All @@ -743,8 +743,7 @@ private static String stageInEnglish(int nextStage) {
case STAGE_DONE:
return "FINISHING";
default:
throw new SolrException(
SolrException.ErrorCode.SERVER_ERROR, "Unrecognized stage:" + nextStage);
return "CUSTOM_STAGE_" + String.valueOf(stage);
}
}

Expand Down

0 comments on commit e668dce

Please sign in to comment.