|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.errorhandling.TimeoutExceptionInjector
@InterfaceAudience.Private public class 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.
Constructor Summary | |
---|---|
TimeoutExceptionInjector(ForeignExceptionListener listener,
long maxTime)
Create a generic timer for a task/process. |
Method Summary | |
---|---|
void |
complete()
For all time forward, do not throw an error because the process has completed. |
long |
getMaxTime()
|
void |
start()
Start a timer to fail a process if it takes longer than the expected time to complete. |
void |
trigger()
Trigger the timer immediately. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimeoutExceptionInjector(ForeignExceptionListener listener, long maxTime)
listener
- listener to notify if the process times outmaxTime
- max allowed running time for the process. Timer starts on calls to
start()
Method Detail |
---|
public long getMaxTime()
public void complete()
public void start() throws IllegalStateException
Non-blocking.
IllegalStateException
- if the timer has already been marked done via complete()
or trigger()
public void trigger()
Exposed for testing.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |