public static class Controls.Builder extends Object
ExecConstants.DRILLBIT_CONTROL_INJECTIONS session option.
The builder class can be reused; it is safe to call build() multiple times to build multiple controls strings in
series. Each new controls string contains all the injections added to the builder before it.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
Controls.Builder |
addException(Class<?> siteClass,
String desc,
Class<? extends Throwable> exceptionClass)
Adds an exception injection to the controls builder with the given parameters.
|
Controls.Builder |
addException(Class<?> siteClass,
String desc,
Class<? extends Throwable> exceptionClass,
int nSkip,
int nFire)
Adds an exception injection to the controls builder with the given parameters.
|
Controls.Builder |
addExceptionOnBit(Class<?> siteClass,
String desc,
Class<? extends Throwable> exceptionClass,
CoordinationProtos.DrillbitEndpoint endpoint)
Adds an exception injection (for the specified drillbit) to the controls builder with the given parameters.
|
Controls.Builder |
addExceptionOnBit(Class<?> siteClass,
String desc,
Class<? extends Throwable> exceptionClass,
CoordinationProtos.DrillbitEndpoint endpoint,
int nSkip,
int nFire)
Adds an exception injection (for the specified drillbit) to the controls builder with the given parameters.
|
Controls.Builder |
addLatch(Class<?> siteClass,
String desc)
Adds a count down latch to the controls builder with the given parameters.
|
Controls.Builder |
addPause(Class<?> siteClass,
String desc)
Adds a pause injection to the controls builder with the given parameters.
|
Controls.Builder |
addPause(Class<?> siteClass,
String desc,
int nSkip)
Adds a pause injection to the controls builder with the given parameters.
|
Controls.Builder |
addPauseOnBit(Class<?> siteClass,
String desc,
CoordinationProtos.DrillbitEndpoint endpoint)
Adds a pause injection (for the specified drillbit) to the controls builder with the given parameters.
|
Controls.Builder |
addPauseOnBit(Class<?> siteClass,
String desc,
CoordinationProtos.DrillbitEndpoint endpoint,
int nSkip)
Adds a pause injection (for the specified drillbit) to the controls builder with the given parameters.
|
Controls.Builder |
addTimedPause(Class<?> siteClass,
String desc,
int nSkip,
long msPause)
Adds a time-bound pause injection to the controls builder with the given parameters.
|
Controls.Builder |
addTimedPauseOnBit(Class<?> siteClass,
String desc,
CoordinationProtos.DrillbitEndpoint endpoint,
int nSkip,
long msPause)
Adds a time-bound pause injection (for the specified drillbit) to the controls builder with the given parameters.
|
String |
build()
Builds the controls string.
|
public Controls.Builder addException(Class<?> siteClass, String desc, Class<? extends Throwable> exceptionClass, int nSkip, int nFire)
siteClass - class where the exception should be throwndesc - descriptor for the exception site in the site classexceptionClass - class of the exception to thrownSkip - number of times to skip before firingnFire - number of times to fire the exceptionpublic Controls.Builder addException(Class<?> siteClass, String desc, Class<? extends Throwable> exceptionClass)
siteClass - class where the exception should be throwndesc - descriptor for the exception site in the site classexceptionClass - class of the exception to throwpublic Controls.Builder addExceptionOnBit(Class<?> siteClass, String desc, Class<? extends Throwable> exceptionClass, CoordinationProtos.DrillbitEndpoint endpoint, int nSkip, int nFire)
siteClass - class where the exception should be throwndesc - descriptor for the exception site in the site classexceptionClass - class of the exception to throwendpoint - the endpoint of the drillbit on which to injectnSkip - number of times to skip before firingnFire - number of times to fire the exceptionpublic Controls.Builder addExceptionOnBit(Class<?> siteClass, String desc, Class<? extends Throwable> exceptionClass, CoordinationProtos.DrillbitEndpoint endpoint)
siteClass - class where the exception should be throwndesc - descriptor for the exception site in the site classexceptionClass - class of the exception to throwendpoint - endpoint of the drillbit on which to injectpublic Controls.Builder addPause(Class<?> siteClass, String desc, int nSkip)
siteClass - class where the pause should happendesc - descriptor for the pause site in the site classnSkip - number of times to skip before firingpublic Controls.Builder addTimedPause(Class<?> siteClass, String desc, int nSkip, long msPause)
siteClass - class where the pause should happendesc - descriptor for the pause site in the site classnSkip - number of times to skip before firingmsPause - duration of the pause in millisecpublic Controls.Builder addPause(Class<?> siteClass, String desc)
siteClass - class where the pause should happendesc - descriptor for the pause site in the site classpublic Controls.Builder addPauseOnBit(Class<?> siteClass, String desc, CoordinationProtos.DrillbitEndpoint endpoint, int nSkip)
siteClass - class where the pause should happendesc - descriptor for the pause site in the site classnSkip - number of times to skip before firingpublic Controls.Builder addTimedPauseOnBit(Class<?> siteClass, String desc, CoordinationProtos.DrillbitEndpoint endpoint, int nSkip, long msPause)
siteClass - class where the pause should happendesc - descriptor for the pause site in the site classnSkip - number of times to skip before firingmsPause - duration of the pause in millisecpublic Controls.Builder addPauseOnBit(Class<?> siteClass, String desc, CoordinationProtos.DrillbitEndpoint endpoint)
siteClass - class where the pause should happendesc - descriptor for the pause site in the site classpublic Controls.Builder addLatch(Class<?> siteClass, String desc)
siteClass - class where the latch should be injecteddesc - descriptor for the latch in the site classpublic String build()
AssertionError - if controls cannot be validated using
ExecutionControls.controlsOptionMapperCopyright © 2022 The Apache Software Foundation. All rights reserved.