Interface MappedBatchLoaderWithContext<K,​V>


  • @PublicSpi
    @NullMarked
    public interface MappedBatchLoaderWithContext<K,​V>
    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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletionStage<java.util.Map<K,​V>> load​(java.util.Set<K> keys, BatchLoaderEnvironment environment)
      Called to batch load the provided keys and return a promise to a map of values.
    • Method Detail

      • load

        java.util.concurrent.CompletionStage<java.util.Map<K,​V>> load​(java.util.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