org.apache.hadoop.hbase
Class RemoteExceptionHandler

java.lang.Object
  extended by org.apache.hadoop.hbase.RemoteExceptionHandler

public class RemoteExceptionHandler
extends java.lang.Object

An immutable class which contains a static method for handling org.apache.hadoop.ipc.RemoteException exceptions.


Method Summary
static java.io.IOException checkIOException(java.io.IOException e)
          Examine passed IOException.
static java.lang.Throwable checkThrowable(java.lang.Throwable t)
          Examine passed Throwable.
static java.io.IOException decodeRemoteException(org.apache.hadoop.ipc.RemoteException re)
          Deprecated. Use RemoteException.unwrapRemoteException() instead. In fact we should look into deprecating this whole class - St.Ack 2010929
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkThrowable

public static java.lang.Throwable checkThrowable(java.lang.Throwable t)
Examine passed Throwable. See if its carrying a RemoteException. If so, run decodeRemoteException(RemoteException) on it. Otherwise, pass back t unaltered.

Parameters:
t - Throwable to examine.
Returns:
Decoded RemoteException carried by t or t unaltered.

checkIOException

public static java.io.IOException checkIOException(java.io.IOException e)
Examine passed IOException. See if its carrying a RemoteException. If so, run decodeRemoteException(RemoteException) on it. Otherwise, pass back e unaltered.

Parameters:
e - Exception to examine.
Returns:
Decoded RemoteException carried by e or e unaltered.

decodeRemoteException

public static java.io.IOException decodeRemoteException(org.apache.hadoop.ipc.RemoteException re)
                                                 throws java.io.IOException
Deprecated. Use RemoteException.unwrapRemoteException() instead. In fact we should look into deprecating this whole class - St.Ack 2010929

Converts org.apache.hadoop.ipc.RemoteException into original exception, if possible. If the original exception is an Error or a RuntimeException, throws the original exception.

Parameters:
re - original exception
Returns:
decoded RemoteException if it is an instance of or a subclass of IOException, or the original RemoteException if it cannot be decoded.
Throws:
java.io.IOException - indicating a server error ocurred if the decoded exception is not an IOException. The decoded exception is set as the cause.


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.