public class DataLoaderDispatcherInstrumentation extends SimpleInstrumentation
Instrumentation
will dispatch
all the contained DataLoader
s when each level of the graphql
query is executed.
This allows you to use DataLoader
s in your DataFetcher
s
to optimal loading of data.DataLoader
,
DataLoaderRegistry
INSTANCE
Constructor and Description |
---|
DataLoaderDispatcherInstrumentation(org.dataloader.DataLoaderRegistry dataLoaderRegistry)
You pass in a registry of N data loaders which will be
dispatched as
each level of the query executes. |
DataLoaderDispatcherInstrumentation(org.dataloader.DataLoaderRegistry dataLoaderRegistry,
DataLoaderDispatcherInstrumentationOptions options)
You pass in a registry of N data loaders which will be
dispatched as
each level of the query executes. |
DataLoaderDispatcherInstrumentation(java.util.function.Supplier<org.dataloader.DataLoaderRegistry> supplier)
You pass in supplier of a registry of N data loaders which will be
dispatched as
each level of the query executes. |
DataLoaderDispatcherInstrumentation(java.util.function.Supplier<org.dataloader.DataLoaderRegistry> supplier,
DataLoaderDispatcherInstrumentationOptions options)
You pass in a supplier of registry of N data loaders which will be
dispatched as
each level of the query executes. |
Modifier and Type | Method and Description |
---|---|
DeferredFieldInstrumentationContext |
beginDeferredField(InstrumentationDeferredFieldParameters parameters)
This is called just before a deferred field is resolved into a value.
|
InstrumentationContext<ExecutionResult> |
beginExecuteOperation(InstrumentationExecuteOperationParameters parameters)
This is called just before the execution of the query operation is started.
|
ExecutionStrategyInstrumentationContext |
beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters)
This is called each time an
ExecutionStrategy is invoked, which may be multiple times
per query as the engine recursively descends down over the query. |
InstrumentationContext<java.lang.Object> |
beginFieldFetch(InstrumentationFieldFetchParameters parameters)
This is called just before a field
DataFetcher is invoked. |
InstrumentationState |
createState()
This will be called just before execution to create an object that is given back to all instrumentation methods
to allow them to have per execution request state
|
DataFetcher<?> |
instrumentDataFetcher(DataFetcher<?> dataFetcher,
InstrumentationFieldFetchParameters parameters)
This is called to instrument a
DataFetcher just before it is used to fetch a field, allowing you
to adjust what information is passed back or record information about specific data fetches. |
java.util.concurrent.CompletableFuture<ExecutionResult> |
instrumentExecutionResult(ExecutionResult executionResult,
InstrumentationExecutionParameters parameters)
This is called to allow instrumentation to instrument the execution result in some way
|
beginExecution, beginField, beginFieldComplete, beginFieldListComplete, beginParse, beginValidation, instrumentExecutionContext, instrumentSchema
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
instrumentExecutionInput
public DataLoaderDispatcherInstrumentation(org.dataloader.DataLoaderRegistry dataLoaderRegistry)
dispatched
as
each level of the query executes.dataLoaderRegistry
- the registry of data loaders that will be dispatchedpublic DataLoaderDispatcherInstrumentation(org.dataloader.DataLoaderRegistry dataLoaderRegistry, DataLoaderDispatcherInstrumentationOptions options)
dispatched
as
each level of the query executes.dataLoaderRegistry
- the registry of data loaders that will be dispatchedoptions
- the options to control the behaviourpublic DataLoaderDispatcherInstrumentation(java.util.function.Supplier<org.dataloader.DataLoaderRegistry> supplier)
dispatched
as
each level of the query executes.supplier
- the supplier of registry of data loaders that will be dispatchedpublic DataLoaderDispatcherInstrumentation(java.util.function.Supplier<org.dataloader.DataLoaderRegistry> supplier, DataLoaderDispatcherInstrumentationOptions options)
dispatched
as
each level of the query executes.dataLoaderRegistry
- the registry of data loaders that will be dispatchedoptions
- the options to control the behaviourpublic InstrumentationState createState()
Instrumentation
createState
in interface Instrumentation
createState
in class SimpleInstrumentation
public DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters)
Instrumentation
DataFetcher
just before it is used to fetch a field, allowing you
to adjust what information is passed back or record information about specific data fetches. Note
the same data fetcher instance maybe presented to you many times and that data fetcher
implementations widely vary.instrumentDataFetcher
in interface Instrumentation
instrumentDataFetcher
in class SimpleInstrumentation
dataFetcher
- the data fetcher about to be usedparameters
- the parameters describing the field to be fetchedpublic InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters)
Instrumentation
beginExecuteOperation
in interface Instrumentation
beginExecuteOperation
in class SimpleInstrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic ExecutionStrategyInstrumentationContext beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters)
Instrumentation
ExecutionStrategy
is invoked, which may be multiple times
per query as the engine recursively descends down over the query.beginExecutionStrategy
in interface Instrumentation
beginExecutionStrategy
in class SimpleInstrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic DeferredFieldInstrumentationContext beginDeferredField(InstrumentationDeferredFieldParameters parameters)
Instrumentation
beginDeferredField
in interface Instrumentation
beginDeferredField
in class SimpleInstrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic InstrumentationContext<java.lang.Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters)
Instrumentation
DataFetcher
is invoked.beginFieldFetch
in interface Instrumentation
beginFieldFetch
in class SimpleInstrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic java.util.concurrent.CompletableFuture<ExecutionResult> instrumentExecutionResult(ExecutionResult executionResult, InstrumentationExecutionParameters parameters)
Instrumentation
instrumentExecutionResult
in interface Instrumentation
instrumentExecutionResult
in class SimpleInstrumentation
executionResult
- CompletableFuture
of the result to instrumentparameters
- the parameters to this step