Class MaxQueryDepthInstrumentation

  • All Implemented Interfaces:
    Instrumentation

    @PublicApi
    public class MaxQueryDepthInstrumentation
    extends SimplePerformantInstrumentation
    Prevents execution if the query depth is greater than the specified maxDepth.

    Use the Function<QueryDepthInfo, Boolean> parameter to supply a function to perform a custom action when the max depth is exceeded. If the function returns true a AbortExecutionException is thrown.

    • Constructor Detail

      • MaxQueryDepthInstrumentation

        public MaxQueryDepthInstrumentation​(int maxDepth)
        Creates a new instrumentation that tracks the query depth.
        Parameters:
        maxDepth - max allowed depth, otherwise execution will be aborted
      • MaxQueryDepthInstrumentation

        public MaxQueryDepthInstrumentation​(int maxDepth,
                                            java.util.function.Function<QueryDepthInfo,​java.lang.Boolean> maxQueryDepthExceededFunction)
        Creates a new instrumentation that tracks the query depth.
        Parameters:
        maxDepth - max allowed depth, otherwise execution will be aborted
        maxQueryDepthExceededFunction - the function to perform when the max depth is exceeded