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 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<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 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<List<?>> beginBatchLoader(DataLoader<?, ?> dataLoader, 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
-