vcsomor commented on a change in pull request #2995:
URL: https://github.com/apache/hive/pull/2995#discussion_r799259349



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metrics/AcidMetricLogger.java
##########
@@ -89,6 +102,42 @@ private void logDeltaMetrics() throws MetaException {
         AcidMetricService.getDeltaCountKey(d.getDbName(), d.getTblName(), 
d.getPartitionName()), d.getMetricValue())));
   }
 
+  private void logOldestInitiatorAge(AcidMetricData acidMetricData) {
+    int oldestInitiatorAge = (int) ((System.currentTimeMillis() - 
acidMetricData.getOldestEnqueueTime()) / 1000L);
+    String oldestInitiatorMessage = "Found compaction entry in compaction 
queue with an age of {} seconds. " +
+        "Consider increasing the number of worker threads.";
+    long oldestInitiatedWarningThreshold = MetastoreConf.getTimeVar(conf,
+        
MetastoreConf.ConfVars.COMPACTOR_OLDEST_INITIATED_COMPACTION_TIME_THRESHOLD_WARNING,
+        TimeUnit.SECONDS);
+    long oldestInitiatedErrorThreshold = MetastoreConf.getTimeVar(conf,
+        
MetastoreConf.ConfVars.COMPACTOR_OLDEST_INITIATED_COMPACTION_TIME_THRESHOLD_ERROR,
+        TimeUnit.SECONDS);
+    if (oldestInitiatorAge >= oldestInitiatedErrorThreshold) {
+      LOG.error(oldestInitiatorMessage, oldestInitiatorAge);
+    } else if (oldestInitiatorAge >= oldestInitiatedWarningThreshold) {
+      LOG.warn(oldestInitiatorMessage, oldestInitiatorAge);
+    }
+  }
+
+  private void logMultipleWorkerVersions(AcidMetricData acidMetricData) {
+    long workerVersionThresholdInMillis = MetastoreConf.getTimeVar(conf,
+        
MetastoreConf.ConfVars.COMPACTOR_WORKER_DETECT_MULTIPLE_VERSION_THRESHOLD, 
TimeUnit.MILLISECONDS);

Review comment:
       good catch




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to