Interface MappedBatchLoaderWithContext<K,V extends @Nullable Object>


@PublicSpi @NullMarked public interface MappedBatchLoaderWithContext<K,V extends @Nullable Object>
This form of MappedBatchLoader is given a BatchLoaderEnvironment object that encapsulates the calling context. A typical use case is passing in security credentials or database details for example.

See MappedBatchLoader for more details on the design invariants that you must implement in order to use this interface.

  • Method Summary

    Modifier and Type
    Method
    Description
    load(Set<K> keys, BatchLoaderEnvironment environment)
    Called to batch load the provided keys and return a promise to a map of values.
  • Method Details

    • load

      CompletionStage<Map<K,V>> load(Set<K> keys, BatchLoaderEnvironment environment)
      Called to batch load the provided keys and return a promise to a map of values.
      Parameters:
      keys - the set of keys to load
      environment - the calling environment
      Returns:
      a promise to a map of values for those keys