org.apache.hadoop.hive.ql.history
Class HiveHistoryImpl

java.lang.Object
  extended by org.apache.hadoop.hive.ql.history.HiveHistoryImpl
All Implemented Interfaces:
HiveHistory

public class HiveHistoryImpl
extends Object
implements HiveHistory

HiveHistory. Logs information such as query, query plan, runtime statistics into a file. Each session uses a new object, which creates a new file.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hive.ql.history.HiveHistory
HiveHistory.Info, HiveHistory.Keys, HiveHistory.Listener, HiveHistory.QueryInfo, HiveHistory.RecordTypes, HiveHistory.SessionInfo, HiveHistory.TaskInfo
 
Constructor Summary
HiveHistoryImpl(SessionState ss)
          Construct HiveHistoryImpl object and open history log file.
 
Method Summary
 void closeStream()
          Close the log file stream
 void endQuery(String queryId)
          Called at the end of a query
 void endTask(String queryId, Task<? extends Serializable> task)
          Called at the end of a task.
 void finalize()
           
 String getHistFileName()
           
 void logPlanProgress(QueryPlan plan)
          Logs the current plan state
 void printRowCount(String queryId)
           
 void progressTask(String queryId, Task<? extends Serializable> task)
          Logs progress of a task if ConfVars.HIVE_LOG_INCREMENTAL_PLAN_PROGRESS is set to true
 void setIdToTableMap(Map<String,String> map)
          Set the id to table name map
 void setQueryProperty(String queryId, HiveHistory.Keys propName, String propValue)
          Used to set query status and other attributes of a query
 void setTaskCounters(String queryId, String taskId, org.apache.hadoop.mapred.Counters ctrs)
          Serialize the task counters and set as a task property.
 void setTaskProperty(String queryId, String taskId, HiveHistory.Keys propName, String propValue)
          Used to set task properties.
 void startQuery(String cmd, String id)
          Called at the start of query execution in Driver.execute().
 void startTask(String queryId, Task<? extends Serializable> task, String taskName)
          Called at the start of a task.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HiveHistoryImpl

public HiveHistoryImpl(SessionState ss)
Construct HiveHistoryImpl object and open history log file.

Parameters:
ss -
Method Detail

getHistFileName

public String getHistFileName()
Specified by:
getHistFileName in interface HiveHistory
Returns:
historyFileName

startQuery

public void startQuery(String cmd,
                       String id)
Description copied from interface: HiveHistory
Called at the start of query execution in Driver.execute().

Specified by:
startQuery in interface HiveHistory

setQueryProperty

public void setQueryProperty(String queryId,
                             HiveHistory.Keys propName,
                             String propValue)
Description copied from interface: HiveHistory
Used to set query status and other attributes of a query

Specified by:
setQueryProperty in interface HiveHistory

setTaskProperty

public void setTaskProperty(String queryId,
                            String taskId,
                            HiveHistory.Keys propName,
                            String propValue)
Description copied from interface: HiveHistory
Used to set task properties.

Specified by:
setTaskProperty in interface HiveHistory

setTaskCounters

public void setTaskCounters(String queryId,
                            String taskId,
                            org.apache.hadoop.mapred.Counters ctrs)
Description copied from interface: HiveHistory
Serialize the task counters and set as a task property.

Specified by:
setTaskCounters in interface HiveHistory

printRowCount

public void printRowCount(String queryId)
Specified by:
printRowCount in interface HiveHistory

endQuery

public void endQuery(String queryId)
Description copied from interface: HiveHistory
Called at the end of a query

Specified by:
endQuery in interface HiveHistory

startTask

public void startTask(String queryId,
                      Task<? extends Serializable> task,
                      String taskName)
Description copied from interface: HiveHistory
Called at the start of a task. Called by Driver.run() A query can have multiple tasks. Tasks will have multiple operator.

Specified by:
startTask in interface HiveHistory

endTask

public void endTask(String queryId,
                    Task<? extends Serializable> task)
Description copied from interface: HiveHistory
Called at the end of a task.

Specified by:
endTask in interface HiveHistory

progressTask

public void progressTask(String queryId,
                         Task<? extends Serializable> task)
Description copied from interface: HiveHistory
Logs progress of a task if ConfVars.HIVE_LOG_INCREMENTAL_PLAN_PROGRESS is set to true

Specified by:
progressTask in interface HiveHistory

logPlanProgress

public void logPlanProgress(QueryPlan plan)
                     throws IOException
Description copied from interface: HiveHistory
Logs the current plan state

Specified by:
logPlanProgress in interface HiveHistory
Throws:
IOException

setIdToTableMap

public void setIdToTableMap(Map<String,String> map)
Description copied from interface: HiveHistory
Set the id to table name map

Specified by:
setIdToTableMap in interface HiveHistory

closeStream

public void closeStream()
Description copied from interface: HiveHistory
Close the log file stream

Specified by:
closeStream in interface HiveHistory

finalize

public void finalize()
              throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable


Copyright © 2014 The Apache Software Foundation. All rights reserved.