for extracting configuration information
an optional CacheLoader for loading the enrichment data
implicit flink config
implicit entity decoder for converting the body of the api call to the cache value type
Construct a sequence of zero or more enriched output events using the input event and the api results.
Construct a sequence of zero or more enriched output events using the input event and the api results.
input event
some api results (or none if api call failed)
Generate the cache key from the input event.
Generate the cache key from the input event. For the default cache loader implementation, this should be a json api endpoint uri. If you provide your own cache loader implementation, this should be whatever is appropriate, however, it must be a String.
the input event
A helper method to enable testing of asyncInvoke() without needing to construct a flink ResultFuture collector.
A helper method to enable testing of asyncInvoke() without needing to construct a flink ResultFuture collector.
the input event
The default cache loader implementation.
The default cache loader implementation. This uses a blaze client to make an api call and converts the result to the cache value type (CV). This loader will be used unless one is passed into the class constructor (usually just done for testing).
Getter for $configPrefix value
An abstract asynchronous function to enrich a data stream with non-stream data. This class relies on guava's CacheBuilder to load and cache the enrichment data. The default cache loader assumes the cache key is a uri of a json api endpoint which it loads asynchronously and converts to the cache value type (CV). You can provide your own cache loader to load enrichment data in some other way. If you use the default loader, note you must implicitly provide a circe EntityDecoder to convert the json api result body to the cache value type.
The behavior of the function can be parameterized with flink config values for
The cache always uses weak keys, allowing for aggressive garbage collection of unused values.
Subclasses must implement the getCacheKey() and enrichEvent() methods.
the input stream element type
the enriched stream output element type
the cache value type