hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject svn commit: r1062655 - in /hive/trunk: CHANGES.txt common/src/java/org/apache/hadoop/hive/conf/HiveConf.java ql/src/java/org/apache/hadoop/hive/ql/stats/StatsFactory.java
Date Mon, 24 Jan 2011 05:42:41 GMT
Author: namit
Date: Mon Jan 24 05:42:41 2011
New Revision: 1062655

URL: http://svn.apache.org/viewvc?rev=1062655&view=rev
Log:
HIVE-1923 Allow any type of stats publisher and aggregator in addition to
HBase and JDBC (Ning Zhang via namit)


Modified:
    hive/trunk/CHANGES.txt
    hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/stats/StatsFactory.java

Modified: hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hive/trunk/CHANGES.txt?rev=1062655&r1=1062654&r2=1062655&view=diff
==============================================================================
--- hive/trunk/CHANGES.txt (original)
+++ hive/trunk/CHANGES.txt Mon Jan 24 05:42:41 2011
@@ -149,6 +149,9 @@ Trunk -  Unreleased
     HIVE-1862 Revive partition filtering in the Hive MetaStore
     (Mac Yang via pauly)
 
+    HIVE-1923 Allow any type of stats publisher and aggregator in addition to
+    HBase and JDBC (Ning Zhang via namit)
+
   IMPROVEMENTS
 
     HIVE-1692. FetchOperator.getInputFormatFromCache hides causal exception (Philip Zeyliger
via cws)

Modified: hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
URL: http://svn.apache.org/viewvc/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java?rev=1062655&r1=1062654&r2=1062655&view=diff
==============================================================================
--- hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (original)
+++ hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java Mon Jan 24 05:42:41
2011
@@ -306,6 +306,11 @@ public class HiveConf extends Configurat
         "org.apache.derby.jdbc.EmbeddedDriver"), // JDBC driver specific to the dbclass
     HIVESTATSDBCONNECTIONSTRING("hive.stats.dbconnectionstring",
         "jdbc:derby:;databaseName=TempStatsStore;create=true"), // automatically create database
+    HIVE_STATS_DEFAULT_PUBLISHER("hive.stats.default.publisher",
+        ""), // default stats publisher if none of JDBC/HBase is specified
+    HIVE_STATS_DEFAULT_AGGREGATOR("hive.stats.default.aggregator",
+        ""), // default stats aggregator if none of JDBC/HBase is specified
+
 
     // Concurrency
     HIVE_SUPPORT_CONCURRENCY("hive.support.concurrency", false),

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/stats/StatsFactory.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/stats/StatsFactory.java?rev=1062655&r1=1062654&r2=1062655&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/stats/StatsFactory.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/stats/StatsFactory.java Mon Jan 24 05:42:41
2011
@@ -24,6 +24,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hive.common.JavaUtils;
+import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.util.ReflectionUtils;
 
 /**
@@ -72,8 +73,22 @@ public final class StatsFactory {
         return false;
       }
     } else {
-      // ERROR
-      return false;
+      // try default stats publisher/aggregator
+      String defPublisher = HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_STATS_DEFAULT_PUBLISHER);
+      String defAggregator = HiveConf.getVar(conf,  HiveConf.ConfVars.HIVE_STATS_DEFAULT_AGGREGATOR);
+      // ERROR no default publisher/aggregator is defined
+      if (defPublisher == null || defAggregator == null) {
+        return false;
+      }
+      try{
+        publisherImplementation = (Class<? extends Serializable>)
+          Class.forName(defPublisher, true, classLoader);
+        aggregatorImplementation = (Class<? extends Serializable>)
+          Class.forName(defAggregator, true, classLoader);
+      } catch (ClassNotFoundException e) {
+        LOG.error("JDBC Publisher/Aggregator classes cannot be loaded.", e);
+        return false;
+      }
     }
 
     jobConf = conf;



Mime
View raw message