dsmiley commented on code in PR #4046:
URL: https://github.com/apache/solr/pull/4046#discussion_r2696340932


##########
solr/solrj/src/java/org/apache/solr/client/solrj/response/RequestStatusState.java:
##########
@@ -54,6 +56,11 @@ public String getKey() {
     return key;
   }
 
+  /** Returns whether the request status should be refreshed given the current 
state. */
+  public boolean shouldRefresh() {

Review Comment:
   I agree on "refresh" not being the most clear word.  Maybe `isFinal` or 
`isFinished`, which implies you may want to get the state again.



##########
solr/solrj/src/java/org/apache/solr/common/util/RetryUtil.java:
##########
@@ -144,6 +154,41 @@ public static void retryUntil(
     throw new SolrException(ErrorCode.SERVER_ERROR, errorMessage);
   }
 
+  /**
+   * Retries a command until it returns a value that matches the given test or 
the maximum number of
+   * retries is reached.
+   *
+   * <p>The command is executed up to {@code retries} times. After each failed 
attempt (when the
+   * command returns a value that returns {@code false} when given to the 
{@code test}), the method
+   * pauses for the specified duration before retrying. If all retries are 
exhausted without
+   * success, a {@link SolrException} is thrown with the provided error 
message.
+   *
+   * @param errorMessage the error message to use if all retries are exhausted
+   * @param retries maximum number of retry attempts
+   * @param pauseTime duration to pause between retries
+   * @param pauseUnit time unit for the pause duration
+   * @param cmd the command to execute
+   * @param test the predicate to test against the value produced by {@code 
cmd}
+   * @throws Exception if the thread is interrupted while sleeping between 
retries or the cmd throws
+   *     an exception
+   * @throws SolrException if all retries are exhausted without success
+   */
+  public static <T> T retryUntil(

Review Comment:
   nice



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to