org.apache.hadoop.hive.ql.exec.errors
Class RegexErrorHeuristic

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.errors.RegexErrorHeuristic
All Implemented Interfaces:
ErrorHeuristic
Direct Known Subclasses:
DataCorruptErrorHeuristic, MapAggrMemErrorHeuristic, ScriptErrorHeuristic

public abstract class RegexErrorHeuristic
extends Object
implements ErrorHeuristic

Simple heuristic where the query and the lines of the task log file are run through regular expressions to see if they resemble a known error condition. Only a single regular expression can be supplied to match the query whereas multiple regular expressions can be supplied to match lines from the log file. A mapping is maintained from the regular expression to the lines from the log file that it matched.


Constructor Summary
RegexErrorHeuristic()
           
 
Method Summary
protected  org.apache.hadoop.mapred.JobConf getConf()
           
abstract  ErrorAndSolution getErrorAndSolution()
          Examine the hive query, job configuration, and the lines from the task log seen so far though processLogLine() and generate a possible cause/solution.
protected  Set<String> getLogRegexes()
           
protected  boolean getQueryMatches()
           
protected  String getQueryRegex()
           
protected  Map<String,List<String>> getRegexToLogLines()
           
 void init(String query, org.apache.hadoop.mapred.JobConf conf)
          Initialize this error heuristic.
 void processLogLine(String line)
          Process the given log line.
protected  void reset()
          Resets to state before any processLogLine() calls.
protected  void setQueryRegex(String queryRegex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexErrorHeuristic

public RegexErrorHeuristic()
Method Detail

setQueryRegex

protected void setQueryRegex(String queryRegex)

getQueryRegex

protected String getQueryRegex()

getQueryMatches

protected boolean getQueryMatches()

getLogRegexes

protected Set<String> getLogRegexes()

getRegexToLogLines

protected Map<String,List<String>> getRegexToLogLines()

getConf

protected org.apache.hadoop.mapred.JobConf getConf()

init

public void init(String query,
                 org.apache.hadoop.mapred.JobConf conf)
Description copied from interface: ErrorHeuristic
Initialize this error heuristic. Must be called before any other methods are called

Specified by:
init in interface ErrorHeuristic

getErrorAndSolution

public abstract ErrorAndSolution getErrorAndSolution()
Description copied from interface: ErrorHeuristic
Examine the hive query, job configuration, and the lines from the task log seen so far though processLogLine() and generate a possible cause/solution. Once this method is called, the implementing class should be reset to the state before any processLogLine() calls were made.

Specified by:
getErrorAndSolution in interface ErrorHeuristic
Returns:
a matching error, or null if a suitable match wasn't found.

processLogLine

public void processLogLine(String line)
Description copied from interface: ErrorHeuristic
Process the given log line. It should be called for every line in the task log file, in sequence.

Specified by:
processLogLine in interface ErrorHeuristic

reset

protected void reset()
Resets to state before any processLogLine() calls.



Copyright © 2011 The Apache Software Foundation