org.apache.hadoop.hive.io
Class HiveIOExceptionHandlerChain

java.lang.Object
  extended by org.apache.hadoop.hive.io.HiveIOExceptionHandlerChain

public class HiveIOExceptionHandlerChain
extends Object

An exception handler chain that process the input exception by going through all exceptions defined in this chain one by one until either one exception handler returns true or it reaches the end of the chain. If it reaches the end of the chain, and still no exception handler returns true, throw the exception to the caller.


Field Summary
static String HIVE_IO_EXCEPTION_HANDLE_CHAIN
           
 
Constructor Summary
HiveIOExceptionHandlerChain()
           
 
Method Summary
protected  List<HiveIOExceptionHandler> getHandlerChain()
           
static HiveIOExceptionHandlerChain getHiveIOExceptionHandlerChain(org.apache.hadoop.mapred.JobConf conf)
           
 org.apache.hadoop.mapred.RecordReader<?,?> handleRecordReaderCreationException(Exception e)
           
 boolean handleRecordReaderNextException(Exception e)
          This is to handle exception when doing next operations.
protected  void setHandlerChain(List<HiveIOExceptionHandler> handlerChain)
          set the exception handler chain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIVE_IO_EXCEPTION_HANDLE_CHAIN

public static String HIVE_IO_EXCEPTION_HANDLE_CHAIN
Constructor Detail

HiveIOExceptionHandlerChain

public HiveIOExceptionHandlerChain()
Method Detail

getHiveIOExceptionHandlerChain

public static HiveIOExceptionHandlerChain getHiveIOExceptionHandlerChain(org.apache.hadoop.mapred.JobConf conf)

getHandlerChain

protected List<HiveIOExceptionHandler> getHandlerChain()
Returns:
the exception handler chain defined

setHandlerChain

protected void setHandlerChain(List<HiveIOExceptionHandler> handlerChain)
set the exception handler chain

Parameters:
handlerChain -

handleRecordReaderCreationException

public org.apache.hadoop.mapred.RecordReader<?,?> handleRecordReaderCreationException(Exception e)
                                                                               throws IOException
Throws:
IOException

handleRecordReaderNextException

public boolean handleRecordReaderNextException(Exception e)
                                        throws IOException
This is to handle exception when doing next operations. Here we use a HiveIOExceptionNextHandleResult to store the results of each handler. If the exception is handled by one handler, the handler should set HiveIOExceptionNextHandleResult to be handled, and also set the handle result. The handle result is used to return the reader's next to determine if need to open a new file for read or not.

Throws:
IOException


Copyright © 2013 The Apache Software Foundation