Package org.dataloader.instrumentation
Interface DataLoaderInstrumentation
- All Known Implementing Classes:
ChainedDataLoaderInstrumentation
This interface is called when certain actions happen inside a data loader
-
Method Summary
Modifier and TypeMethodDescriptiondefault DataLoaderInstrumentationContext<List<?>>
beginBatchLoader
(DataLoader<?, ?> dataLoader, 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<Object>
beginLoad
(DataLoader<?, ?> dataLoader, Object key, 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 Details
-
beginLoad
default DataLoaderInstrumentationContext<Object> beginLoad(DataLoader<?, ?> dataLoader, Object key, 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<List<?>> beginBatchLoader(DataLoader<?, ?> dataLoader, 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
-