Class AsyncLookupRetries
Callbacks run directly, without a helper-owned executor. A work counter turns an immediate failure's retry into a loop, so the retry budget cannot grow the calling thread's stack. Each invocation has its own counter, retry budget and result.
Cancellation of the returned future stops further retries but does not cancel an in-flight
read. Flink's AsyncLookupFunction.eval and CachingAsyncLookupFunction chain
completion without propagating cancellation to the lookup's future (Flink 1.20.4 and 2.2.1). The
client futures also differ: Bigtable's classic point-read future supports upstream cancellation,
while Spanner's single-row and Firestore's document futures do not wire cancellation to their
streams (libraries-bom 26.90.0). The helper therefore carries no active-call cancellation handle.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceConverts a client value to rows, allowing a deserializer's checked exception. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CompletableFuture<Collection<org.apache.flink.table.data.RowData>>lookup(Supplier<com.google.api.core.ApiFuture<T>> read, AsyncLookupRetries.RowConverter<T> converter, Predicate<Throwable> isRetryable, int maxRetries) Starts one read and retries classified failures up tomaxRetriestimes after the initial attempt.
-
Method Details
-
lookup
public static <T> CompletableFuture<Collection<org.apache.flink.table.data.RowData>> lookup(Supplier<com.google.api.core.ApiFuture<T>> read, AsyncLookupRetries.RowConverter<T> converter, Predicate<Throwable> isRetryable, int maxRetries) Starts one read and retries classified failures up tomaxRetriestimes after the initial attempt. A read that throws at once is handled like a failed future. Conversion failures complete the result exceptionally without another read.- Type Parameters:
T- the client library's read-result type- Parameters:
read- starts a new read of the same key on each callconverter- converts the successful value, including a nullable missing-row valueisRetryable- classifies read failures using the connector's policymaxRetries- the connector-validated non-negative number of retries- Returns:
- the rows or the last read or conversion failure
-