Package org.dataloader.instrumentation
Interface DataLoaderInstrumentation
-
- All Known Implementing Classes:
ChainedDataLoaderInstrumentation
@PublicSpi public interface DataLoaderInstrumentation
This interface is called when certain actions happen inside a data loader
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description 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 aDataLoaderis invoked.default DataLoaderInstrumentationContext<DispatchResult<?>>beginDispatch(DataLoader<?,?> dataLoader)This call back is done just before theDataLoader.dispatch()is invoked, and it completes when the dispatch call promise is done.default DataLoaderInstrumentationContext<java.lang.Object>beginLoad(DataLoader<?,?> dataLoader, java.lang.Object key, java.lang.Object loadContext)This call back is done just before theDataLoader.load(Object)methods are invoked, and it completes when the load promise is completed.
-
-
-
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 theDataLoader.load(Object)methods are invoked, and it completes when the load promise is completed. If the value is a cachedCompletableFuturethen it might return almost immediately, otherwise it will return when the batch load function is invoked and values get returned- Parameters:
dataLoader- theDataLoaderin questionkey- the key used during theDataLoader.load(Object)callloadContext- the load context used during theDataLoader.load(Object, Object)call- Returns:
- a DataLoaderInstrumentationContext or null to be more performant
-
beginDispatch
default DataLoaderInstrumentationContext<DispatchResult<?>> beginDispatch(DataLoader<?,?> dataLoader)
This call back is done just before theDataLoader.dispatch()is invoked, and it completes when the dispatch call promise is done.- Parameters:
dataLoader- theDataLoaderin question- 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 aDataLoaderis invoked. Remember a batch loader could be called multiple times during a dispatch event (because of max batch sizes)- Parameters:
dataLoader- theDataLoaderin questionkeys- the set of keys being fetchedenvironment- theBatchLoaderEnvironment- Returns:
- a DataLoaderInstrumentationContext or null to be more performant
-
-