org.apache.hadoop.hbase.util
Class ExceptionUtil
java.lang.Object
org.apache.hadoop.hbase.util.ExceptionUtil
public class ExceptionUtil
- extends Object
This class handles the different interruption classes.
It can be:
- InterruptedException
- InterruptedIOException (inherits IOException); used in IO
- ClosedByInterruptException (inherits IOException)
, - SocketTimeoutException inherits InterruptedIOException but is not a real
interruption, so we have to distinguish the case. This pattern is unfortunately common.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
isInterrupt
public static boolean isInterrupt(Throwable t)
- Returns:
- true if the throwable comes an interruption, false otherwise.
rethrowIfInterrupt
public static void rethrowIfInterrupt(Throwable t)
throws InterruptedIOException
- Throws:
InterruptedIOException
- if t was an interruption. Does nothing otherwise.
asInterrupt
public static InterruptedIOException asInterrupt(Throwable t)
- Returns:
- an InterruptedIOException if t was an interruption, null otherwise
Copyright © 2015 The Apache Software Foundation. All Rights Reserved.