dlmarion commented on code in PR #3292:
URL: https://github.com/apache/accumulo/pull/3292#discussion_r1170179504
##########
core/src/main/java/org/apache/accumulo/core/spi/scan/ScanServerSelector.java:
##########
@@ -106,11 +108,46 @@ interface SelectorParameters {
* were set, an empty map is returned.
*/
Map<String,String> getHints();
+
+ /**
+ * This function helps a scan server selector wait for an optional to
become non-empty (like
+ * waiting for scan servers to be present) and throws exceptions when
waiting is no longer
+ * possible OR returning false if the max wait time was exceeded. The
passed in condition will
+ * be periodically called and as long as it returns an empty optional the
function will continue
+ * to wait.
+ *
+ * @param condition periodically calls this to see if it is non-empty.
+ * @param maxWaitTime the maximum time to wait for the condition to become
non-empty
+ * @param description a description of what is being waited on, used for
error messages and
+ * logging
+ * @return The first non-empty optional returned by the condition. An
empty optional if the
+ * maxWaitTime was exceeded without the condition ever returning a
non-empty optional.
+ *
+ * @throws org.apache.accumulo.core.client.TableDeletedException if the
table is deleted while
+ * waiting for the condition to become non-empty. Do not catch
this exception, let it
+ * escape.
+ * @throws org.apache.accumulo.core.client.TimedOutException if the
timeout specified by
+ * {@link ScannerBase#setTimeout(long, TimeUnit)} is exceeded
while waiting. Do not
+ * catch this exception, let it escape.
+ *
+ * @since ELASTICITY_TODO
Review Comment:
I think you can change these to 4.0.0. I merged the PR into elasticity
branch that set this version.
--
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]