diff --git a/common/src/java/org/apache/hadoop/hive/common/metrics/common/MetricsConstant.java b/common/src/java/org/apache/hadoop/hive/common/metrics/common/MetricsConstant.java index f18aa6e..95e2bcf 100644 --- a/common/src/java/org/apache/hadoop/hive/common/metrics/common/MetricsConstant.java +++ b/common/src/java/org/apache/hadoop/hive/common/metrics/common/MetricsConstant.java @@ -29,11 +29,6 @@ public static final String OPEN_CONNECTIONS = "open_connections"; public static final String OPEN_OPERATIONS = "open_operations"; - public static final String JDO_ACTIVE_TRANSACTIONS = "active_jdo_transactions"; - public static final String JDO_ROLLBACK_TRANSACTIONS = "rollbacked_jdo_transactions"; - public static final String JDO_COMMIT_TRANSACTIONS = "committed_jdo_transactions"; - public static final String JDO_OPEN_TRANSACTIONS = "opened_jdo_transactions"; - public static final String METASTORE_HIVE_LOCKS = "metastore_hive_locks"; public static final String ZOOKEEPER_HIVE_SHAREDLOCKS = "zookeeper_hive_sharedlocks"; public static final String ZOOKEEPER_HIVE_EXCLUSIVELOCKS = "zookeeper_hive_exclusivelocks"; diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreMetrics.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreMetrics.java index c9da95a..f571c7c 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreMetrics.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreMetrics.java @@ -93,11 +93,6 @@ public void testMetricsFile() throws Exception { JsonNode methodCounterNode = timersNode.path("api_get_all_databases"); JsonNode methodCountNode = methodCounterNode.path("count"); Assert.assertTrue(methodCountNode.asInt() > 0); - - JsonNode countersNode = rootNode.path("counters"); - JsonNode committedJdoTxNode = countersNode.path("committed_jdo_transactions"); - JsonNode committedCountNode = committedJdoTxNode.path("count"); - Assert.assertTrue(committedCountNode.asInt() > 0); } diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java index 803c6e7..3d552f7 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java @@ -64,10 +64,6 @@ import org.apache.hadoop.hive.common.ObjectPair; import org.apache.hadoop.hive.common.classification.InterfaceAudience; import org.apache.hadoop.hive.common.classification.InterfaceStability; -import org.apache.hadoop.hive.common.metrics.common.Metrics; -import org.apache.hadoop.hive.common.metrics.common.MetricsConstant; -import org.apache.hadoop.hive.common.metrics.common.MetricsFactory; -import org.apache.hadoop.hive.common.metrics.common.MetricsVariable; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.conf.HiveConf.ConfVars; import org.apache.hadoop.hive.metastore.api.AggrStats; @@ -287,17 +283,6 @@ public void setConf(Configuration conf) { initialize(propsFromConf); - //Add metric for number of active JDO transactions. - Metrics metrics = MetricsFactory.getInstance(); - if (metrics != null) { - metrics.addGauge(MetricsConstant.JDO_ACTIVE_TRANSACTIONS, new MetricsVariable() { - @Override - public Object getValue() { - return openTrasactionCalls; - } - }); - } - String partitionValidationRegex = hiveConf.get(HiveConf.ConfVars.METASTORE_PARTITION_NAME_WHITELIST_PATTERN.name()); if (partitionValidationRegex != null && partitionValidationRegex.equals("")) { @@ -472,7 +457,6 @@ public boolean openTransaction() { boolean result = currentTransaction.isActive(); debugLog("Open transaction: count = " + openTrasactionCalls + ", isActive = " + result); - incrementMetricsCount(MetricsConstant.JDO_OPEN_TRANSACTIONS); return result; } @@ -511,7 +495,6 @@ public boolean commitTransaction() { currentTransaction.commit(); } - incrementMetricsCount(MetricsConstant.JDO_COMMIT_TRANSACTIONS); return true; } @@ -549,7 +532,6 @@ public void rollbackTransaction() { // from reattaching in future transactions pm.evictAll(); } - incrementMetricsCount(MetricsConstant.JDO_ROLLBACK_TRANSACTIONS); } @Override @@ -7330,17 +7312,6 @@ public boolean doesPartitionExist(String dbName, String tableName, List } } - private void incrementMetricsCount(String name) { - try { - Metrics metrics = MetricsFactory.getInstance(); - if (metrics != null) { - metrics.incrementCounter(name); - } - } catch (Exception e) { - LOG.warn("Error Reporting JDO operation to Metrics system", e); - } - } - private void debugLog(String message) { if (LOG.isDebugEnabled()) { LOG.debug(message + getCallStack());