Interface ScanServerSelector.SelectorParameters
- Enclosing interface:
- ScanServerSelector
public static interface ScanServerSelector.SelectorParameters
This interface exists so that is easier to evolve what is passed to
ScanServerSelector.selectServers(SelectorParameters)
without having to make breaking
changes.- Since:
- 2.1.0
-
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends ScanServerAttempt>
getAttempts
(TabletId tabletId) getHints()
<T> Optional<T>
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.
-
Method Details
-
getTablets
Collection<TabletId> getTablets()- Returns:
- the set of tablets to be scanned
-
getAttempts
- Returns:
- scan attempt information for the tablet
-
getHints
- Returns:
- any hints set on a scanner using
ScannerBase.setExecutionHints(Map)
. If none were set, an empty map is returned.
-
waitUntil
<T> Optional<T> waitUntil(Supplier<Optional<T>> condition, Duration maxWaitTime, String description) 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.- Parameters:
condition
- periodically calls this to see if it is non-empty.maxWaitTime
- the maximum time to wait for the condition to become non-emptydescription
- a description of what is being waited on, used for error messages and logging- Returns:
- 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:
TableDeletedException
- if the table is deleted while waiting for the condition to become non-empty. Do not catch this exception, let it escape.TimedOutException
- if the timeout specified byScannerBase.setTimeout(long, TimeUnit)
is exceeded while waiting. Do not catch this exception, let it escape.- Since:
- 4.0.0
-