Class TimeoutExceptionInjector
java.lang.Object
org.apache.hadoop.hbase.errorhandling.TimeoutExceptionInjector
Time a given process/operation and report a failure if the elapsed time exceeds the max allowed
time.
The timer won't start tracking time until calling start(). If complete() or
trigger() is called before start(), calls to start() will fail.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTimeoutExceptionInjector(ForeignExceptionListener listener, long maxTime) Create a generic timer for a task/process. -
Method Summary
-
Field Details
-
LOG
-
maxTime
-
complete
-
timer
-
timerTask
-
start
-
-
Constructor Details
-
TimeoutExceptionInjector
Create a generic timer for a task/process.- Parameters:
listener- listener to notify if the process times outmaxTime- max allowed running time for the process. Timer starts on calls tostart()
-
-
Method Details
-
getMaxTime
-
complete
For all time forward, do not throw an error because the process has completed. -
start
Start a timer to fail a process if it takes longer than the expected time to complete.Non-blocking.
- Throws:
IllegalStateException- if the timer has already been marked done viacomplete()ortrigger()
-
trigger
Trigger the timer immediately.Exposed for testing.
-