org.apache.hadoop.hive.ql.stats.jdbc
Class JDBCStatsPublisher

java.lang.Object
  extended by org.apache.hadoop.hive.ql.stats.jdbc.JDBCStatsPublisher
All Implemented Interfaces:
StatsPublisher

public class JDBCStatsPublisher
extends Object
implements StatsPublisher


Constructor Summary
JDBCStatsPublisher()
           
 
Method Summary
 boolean closeConnection()
          This method closes the connection to the temporary storage.
 boolean connect(org.apache.hadoop.conf.Configuration hiveconf)
          This method connects to the intermediate statistics database.
 boolean init(org.apache.hadoop.conf.Configuration hconf)
          This method does the necessary one-time initializations, possibly creating the tables and database (if not exist).
 boolean publishStat(String fileID, String statType, String value)
          This method publishes a given statistic into a disk storage, possibly HBase or MySQL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCStatsPublisher

public JDBCStatsPublisher()
Method Detail

connect

public boolean connect(org.apache.hadoop.conf.Configuration hiveconf)
Description copied from interface: StatsPublisher
This method connects to the intermediate statistics database.

Specified by:
connect in interface StatsPublisher
Parameters:
hiveconf - HiveConf that contains the connection parameters.
Returns:
true if connection is successful, false otherwise.

publishStat

public boolean publishStat(String fileID,
                           String statType,
                           String value)
Description copied from interface: StatsPublisher
This method publishes a given statistic into a disk storage, possibly HBase or MySQL. fileID : a string identification the statistics to be published by all mappers/reducers and then gathered. The statID is unique per output partition per task, e.g.,: the output directory name (uniq per FileSinkOperator) + the partition specs (only for dynamic partitions) + taskID (last component of task file) statType : a string noting the key to be published. Ex: "numRows". value : an integer noting the value of the published key.

Specified by:
publishStat in interface StatsPublisher

closeConnection

public boolean closeConnection()
Description copied from interface: StatsPublisher
This method closes the connection to the temporary storage.

Specified by:
closeConnection in interface StatsPublisher

init

public boolean init(org.apache.hadoop.conf.Configuration hconf)
Description copied from interface: StatsPublisher
This method does the necessary one-time initializations, possibly creating the tables and database (if not exist). This method is usually called in the Hive client side rather than by the mappers/reducers so that it is initialized only once.

Specified by:
init in interface StatsPublisher
Parameters:
hconf - HiveConf that contains the configurations parameters used to connect to intermediate stats database.
Returns:
true if initialization is successful, false otherwise.


Copyright © 2011 The Apache Software Foundation