Package org.apache.drill.exec.testing
Class ExceptionInjection
java.lang.Object
org.apache.drill.exec.testing.Injection
org.apache.drill.exec.testing.ExceptionInjection
Injection for a single exception. Specifies how many times to inject it, and how many times to skip
injecting it before the first injection. This class is used internally for tracking injected
exceptions; injected exceptions are specified via the
ExecConstants.DRILLBIT_CONTROL_INJECTIONS
session option.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends Throwable>
voidthrowChecked
(Class<T> exceptionClass) Throw the checked exception specified by this injection.void
Throw the unchecked exception specified by this injection.Methods inherited from class org.apache.drill.exec.testing.Injection
getDesc, getMsPause, getSiteClass, injectNow, isValidForBit, toString
-
Method Details
-
throwUnchecked
public void throwUnchecked()Throw the unchecked exception specified by this injection.- Throws:
IllegalStateException
- if it's time to throw, and the injection specified a checked exception
-
throwChecked
Throw the checked exception specified by this injection.- Parameters:
exceptionClass
- the class of the exception to throw- Throws:
T
- if it is time to throw the exceptionIllegalStateException
- if it is time to throw the exception, and the exception's class is incompatible with the class specified by the injection
-