Repository: hive
Updated Branches:
  refs/heads/branch-2.1 ee89e32a1 -> ef2465217


HIVE-14764 : Enabling "hive.metastore.metrics.enabled" throws OOM in 
HiveMetastore (Rajesh Balamohan, reviewed by Vaibhav Gumashta)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/ef246521
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/ef246521
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/ef246521

Branch: refs/heads/branch-2.1
Commit: ef2465217982fda68c92ff40969868a95d6bfa47
Parents: ee89e32
Author: Rajesh Balamohan <rbalamohan at apache dot org>
Authored: Fri Sep 16 00:28:16 2016 -0700
Committer: Thejas Nair <the...@hortonworks.com>
Committed: Fri Sep 16 00:32:15 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hive/metastore/HiveMetaStore.java    | 50 +++++++++++---------
 1 file changed, 27 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/ef246521/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
----------------------------------------------------------------------
diff --git 
a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 
b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
index d2d367a..c7e3a6a 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
@@ -4480,7 +4480,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
       dbName = dbName.toLowerCase();
       tableName = tableName.toLowerCase();
       colName = colName.toLowerCase();
-      startFunction("get_column_statistics_by_table: db=" + dbName + " table=" 
+ tableName +
+      startFunction("get_column_statistics_by_table", ": db=" + dbName + " 
table=" + tableName +
                     " column=" + colName);
       ColumnStatistics statsObj = null;
       try {
@@ -4491,7 +4491,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         }
         return statsObj;
       } finally {
-        endFunction("get_column_statistics_by_table: ", statsObj != null, 
null, tableName);
+        endFunction("get_column_statistics_by_table", statsObj != null, null, 
tableName);
       }
     }
 
@@ -4500,7 +4500,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         throws MetaException, NoSuchObjectException, TException {
       String dbName = request.getDbName().toLowerCase();
       String tblName = request.getTblName().toLowerCase();
-      startFunction("get_table_statistics_req: db=" + dbName + " table=" + 
tblName);
+      startFunction("get_table_statistics_req", ": db=" + dbName + " table=" + 
tblName);
       TableStatsResult result = null;
       List<String> lowerCaseColNames = new 
ArrayList<String>(request.getColNames().size());
       for (String colName : request.getColNames()) {
@@ -4511,7 +4511,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         result = new TableStatsResult((cs == null || cs.getStatsObj() == null)
             ? Lists.<ColumnStatisticsObj>newArrayList() : cs.getStatsObj());
       } finally {
-        endFunction("get_table_statistics_req: ", result == null, null, 
tblName);
+        endFunction("get_table_statistics_req", result == null, null, tblName);
       }
       return result;
     }
@@ -4524,8 +4524,9 @@ public class HiveMetaStore extends ThriftHiveMetastore {
       tableName = tableName.toLowerCase();
       colName = colName.toLowerCase();
       String convertedPartName = lowerCaseConvertPartName(partName);
-      startFunction("get_column_statistics_by_partition: db=" + dbName + " 
table=" + tableName +
-          " partition=" + convertedPartName + " column=" + colName);
+      startFunction("get_column_statistics_by_partition",
+              ": db=" + dbName + " table=" + tableName
+              + " partition=" + convertedPartName + " column=" + colName);
       ColumnStatistics statsObj = null;
 
       try {
@@ -4537,7 +4538,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         }
         statsObj = list.get(0);
       } finally {
-        endFunction("get_column_statistics_by_partition: ", statsObj != null, 
null, tableName);
+        endFunction("get_column_statistics_by_partition", statsObj != null, 
null, tableName);
       }
       return statsObj;
     }
@@ -4547,7 +4548,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         throws MetaException, NoSuchObjectException, TException {
       String dbName = request.getDbName().toLowerCase();
       String tblName = request.getTblName().toLowerCase();
-      startFunction("get_partitions_statistics_req: db=" + dbName + " table=" 
+ tblName);
+      startFunction("get_partitions_statistics_req", ": db=" + dbName + " 
table=" + tblName);
 
       PartitionsStatsResult result = null;
       List<String> lowerCaseColNames = new 
ArrayList<String>(request.getColNames().size());
@@ -4568,7 +4569,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         }
         result = new PartitionsStatsResult(map);
       } finally {
-        endFunction("get_partitions_statistics_req: ", result == null, null, 
tblName);
+        endFunction("get_partitions_statistics_req", result == null, null, 
tblName);
       }
       return result;
     }
@@ -4592,11 +4593,11 @@ public class HiveMetaStore extends ThriftHiveMetastore {
 
       List<ColumnStatisticsObj> statsObjs =  colStats.getStatsObj();
 
+      startFunction("write_column_statistics", ":  db=" + dbName
+          + " table=" + tableName + " column=" + colName);
       for (ColumnStatisticsObj statsObj:statsObjs) {
         colName = statsObj.getColName().toLowerCase();
         statsObj.setColName(colName);
-        startFunction("write_column_statistics:  db=" + dbName + " table=" + 
tableName +
-          " column=" + colName);
       }
 
      colStats.setStatsDesc(statsDesc);
@@ -4608,7 +4609,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         ret = getMS().updateTableColumnStatistics(colStats);
         return ret;
       } finally {
-        endFunction("write_column_statistics: ", ret != false, null, 
tableName);
+        endFunction("write_column_statistics", ret != false, null, tableName);
       }
     }
 
@@ -4633,11 +4634,12 @@ public class HiveMetaStore extends ThriftHiveMetastore {
 
       List<ColumnStatisticsObj> statsObjs =  colStats.getStatsObj();
 
+      startFunction("write_partition_column_statistics",
+          ":  db=" + dbName + " table=" + tableName
+              + " part=" + partName + "column=" + colName);
       for (ColumnStatisticsObj statsObj:statsObjs) {
         colName = statsObj.getColName().toLowerCase();
         statsObj.setColName(colName);
-        startFunction("write_partition_column_statistics:  db=" + dbName + " 
table=" + tableName +
-            " part=" + partName + "column=" + colName);
       }
 
       colStats.setStatsDesc(statsDesc);
@@ -4653,7 +4655,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         ret = getMS().updatePartitionColumnStatistics(colStats, partVals);
         return ret;
       } finally {
-        endFunction("write_partition_column_statistics: ", ret != false, null, 
tableName);
+        endFunction("write_partition_column_statistics", ret != false, null, 
tableName);
       }
     }
 
@@ -4675,8 +4677,9 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         colName = colName.toLowerCase();
       }
       String convertedPartName = lowerCaseConvertPartName(partName);
-      startFunction("delete_column_statistics_by_partition: db=" + dbName + " 
table=" + tableName +
-                    " partition=" + convertedPartName + " column=" + colName);
+      startFunction("delete_column_statistics_by_partition",": db=" + dbName
+          + " table=" + tableName + " partition=" + convertedPartName
+          + " column=" + colName);
       boolean ret = false;
 
       try {
@@ -4684,7 +4687,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         ret = getMS().deletePartitionColumnStatistics(dbName, tableName,
                                                       convertedPartName, 
partVals, colName);
       } finally {
-        endFunction("delete_column_statistics_by_partition: ", ret != false, 
null, tableName);
+        endFunction("delete_column_statistics_by_partition", ret != false, 
null, tableName);
       }
       return ret;
     }
@@ -4699,14 +4702,14 @@ public class HiveMetaStore extends ThriftHiveMetastore {
       if (colName != null) {
         colName = colName.toLowerCase();
       }
-      startFunction("delete_column_statistics_by_table: db=" + dbName + " 
table=" + tableName +
-                    " column=" + colName);
+      startFunction("delete_column_statistics_by_table", ": db=" + dbName
+          + " table=" + tableName + " column=" + colName);
 
       boolean ret = false;
       try {
         ret = getMS().deleteTableColumnStatistics(dbName, tableName, colName);
       } finally {
-        endFunction("delete_column_statistics_by_table: ", ret != false, null, 
tableName);
+        endFunction("delete_column_statistics_by_table", ret != false, null, 
tableName);
       }
       return ret;
     }
@@ -6057,7 +6060,8 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         throws NoSuchObjectException, MetaException, TException {
       String dbName = request.getDbName().toLowerCase();
       String tblName = request.getTblName().toLowerCase();
-      startFunction("get_aggr_stats_for: db=" + request.getDbName() + " 
table=" + request.getTblName());
+      startFunction("get_aggr_stats_for", ": db=" + request.getDbName()
+          + " table=" + request.getTblName());
 
       List<String> lowerCaseColNames = new 
ArrayList<String>(request.getColNames().size());
       for (String colName : request.getColNames()) {
@@ -6074,7 +6078,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
             lowerCaseColNames));
         return aggrStats;
       } finally {
-          endFunction("get_partitions_statistics_req: ", aggrStats == null, 
null, request.getTblName());
+          endFunction("get_aggr_stats_for", aggrStats == null, null, 
request.getTblName());
       }
 
     }

Reply via email to