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 aDataLoader
is 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 cachedCompletableFuture
then it might return almost immediately, otherwise it will return when the batch load function is invoked and values get returned- Parameters:
dataLoader
- theDataLoader
in 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
- theDataLoader
in 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 aDataLoader
is invoked. Remember a batch loader could be called multiple times during a dispatch event (because of max batch sizes)- Parameters:
dataLoader
- theDataLoader
in questionkeys
- the set of keys being fetchedenvironment
- theBatchLoaderEnvironment
- Returns:
- a DataLoaderInstrumentationContext or null to be more performant
-
-