You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/05/19 13:45:31 UTC

[GitHub] [hive] klcopp commented on a change in pull request #2281: HIVE-25079: Create new metric about number of writes to tables with m…

klcopp commented on a change in pull request #2281:
URL: https://github.com/apache/hive/pull/2281#discussion_r635252137



##########
File path: ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCompactionMetrics.java
##########
@@ -687,6 +689,26 @@ static boolean equivalent(Map<String, String> lhs, Map<String, String> rhs) {
     return value.isEmpty()? Collections.emptyMap() : Splitter.on(',').withKeyValueSeparator("->").split(value);
   }
 
+  @Test
+  public void textWritesToDisabledCompactionTable() throws Exception {

Review comment:
       nit: typo "text" -> "test"

##########
File path: ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCompactionMetrics.java
##########
@@ -687,6 +689,26 @@ static boolean equivalent(Map<String, String> lhs, Map<String, String> rhs) {
     return value.isEmpty()? Collections.emptyMap() : Splitter.on(',').withKeyValueSeparator("->").split(value);
   }
 
+  @Test
+  public void textWritesToDisabledCompactionTable() throws Exception {
+    MetastoreConf.setVar(conf, MetastoreConf.ConfVars.TRANSACTIONAL_EVENT_LISTENERS, "org.apache.hadoop.hive.metastore.HMSMetricsListener");

Review comment:
       nit: HMSMetricsListener.class.getName() would be nicer

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSMetricsListener.java
##########
@@ -86,4 +92,24 @@ public void onAddPartition(AddPartitionEvent partitionEvent) throws MetaExceptio
     Metrics.getOrCreateGauge(MetricsConstants.TOTAL_PARTITIONS).incrementAndGet();
     createdParts.inc();
   }
+
+  @Override
+  public void onAllocWriteId(AllocWriteIdEvent allocWriteIdEvent, Connection dbConn, SQLGenerator sqlGenerator) throws MetaException {
+    Table table = getTable(allocWriteIdEvent);

Review comment:
       Before doing anything we should first check if metrics are enabled 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org