Interface DataLoaderInstrumentation

    • Method Detail

      • beginLoad

        default DataLoaderInstrumentationContext<java.lang.Object> beginLoad​(DataLoader<?,​?> dataLoader,
                                                                             java.lang.Object key,
                                                                             java.lang.Object loadContext)
        This call back is done just before the DataLoader.load(Object) methods are invoked, and it completes when the load promise is completed. If the value is a cached CompletableFuture then it might return almost immediately, otherwise it will return when the batch load function is invoked and values get returned
        Parameters:
        dataLoader - the DataLoader in question
        key - the key used during the DataLoader.load(Object) call
        loadContext - the load context used during the DataLoader.load(Object, Object) call
        Returns:
        a DataLoaderInstrumentationContext or null to be more performant
      • beginBatchLoader

        default DataLoaderInstrumentationContext<java.util.List<?>> beginBatchLoader​(DataLoader<?,​?> dataLoader,
                                                                                     java.util.List<?> keys,
                                                                                     BatchLoaderEnvironment environment)
        This call back is done just before the `batch loader` of a DataLoader is invoked. Remember a batch loader could be called multiple times during a dispatch event (because of max batch sizes)
        Parameters:
        dataLoader - the DataLoader in question
        keys - the set of keys being fetched
        environment - the BatchLoaderEnvironment
        Returns:
        a DataLoaderInstrumentationContext or null to be more performant