Package org.apache.drill.exec.testing
Class ExecutionControls
java.lang.Object
org.apache.drill.exec.testing.ExecutionControls
Tracks the simulated controls that will be injected for testing purposes.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The JSON specified for theExecConstants.DRILLBIT_CONTROL_INJECTIONS
option is validated using this class.static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.fasterxml.jackson.databind.ObjectMapper
static final String
The default value for controls. -
Constructor Summary
ConstructorDescriptionExecutionControls
(OptionManager options) ExecutionControls
(OptionManager options, CoordinationProtos.DrillbitEndpoint endpoint) -
Method Summary
Modifier and TypeMethodDescriptionlookupCountDownLatchInjection
(ExecutionControlsInjector injector, String desc) Look for a count down latch injection matching the given injector, site descriptor, and endpoint.lookupExceptionInjection
(ExecutionControlsInjector injector, String desc) Look for an exception injection matching the given injector, site descriptor, and endpoint.lookupPauseInjection
(ExecutionControlsInjector injector, String desc) Look for an pause injection matching the given injector, site descriptor, and endpoint.void
This method resumes all pauses within the current context (QueryContext or FragmentContext).static void
validateControlsString
(String jsonString)
-
Field Details
-
controlsOptionMapper
public static final com.fasterxml.jackson.databind.ObjectMapper controlsOptionMapper -
EMPTY_CONTROLS
The default value for controls.- See Also:
-
-
Constructor Details
-
ExecutionControls
-
ExecutionControls
-
-
Method Details
-
validateControlsString
- Throws:
IOException
-
lookupExceptionInjection
Look for an exception injection matching the given injector, site descriptor, and endpoint.- Parameters:
injector
- the injector, which indicates a classdesc
- the injection site description- Returns:
- the exception injection, if there is one for the injector, site and endpoint; null otherwise
-
lookupPauseInjection
Look for an pause injection matching the given injector, site descriptor, and endpoint.- Parameters:
injector
- the injector, which indicates a classdesc
- the injection site description- Returns:
- the pause injection, if there is one for the injector, site and endpoint; null otherwise
-
lookupCountDownLatchInjection
public CountDownLatchInjection lookupCountDownLatchInjection(ExecutionControlsInjector injector, String desc) Look for a count down latch injection matching the given injector, site descriptor, and endpoint.- Parameters:
injector
- the injector, which indicates a classdesc
- the injection site description- Returns:
- the count down latch injection, if there is one for the injector, site and endpoint; otherwise, a latch that does nothing
-
unpauseAll
public void unpauseAll()This method resumes all pauses within the current context (QueryContext or FragmentContext).
-