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/03/29 14:29:08 UTC

[GitHub] [hive] klcopp commented on a change in pull request #2115: HIVE-24932: Create new metric about Initiator / Worker hosts

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



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metrics/AcidMetricService.java
##########
@@ -125,6 +126,30 @@ public static void updateMetricsFromShowCompact(ShowCompactResponse showCompactR
       Metrics.getOrCreateGauge(MetricsConstants.COMPACTION_OLDEST_ENQUEUE_AGE)
           .set((int) ((System.currentTimeMillis() - oldestEnqueueTime) / 1000L));
     }
+
+    long initiatorsCount = lastElements.values().stream()
+        .map(e -> getHostFromId(e.getInitiatorId())).distinct().filter(e -> !NO_VAL.equals(e)).count();
+    Metrics.getOrCreateGauge(MetricsConstants.COMPACTION_STATUS_PREFIX + "initiators").set((int) initiatorsCount);

Review comment:
       Would be best to make new MetricsConstants out of these metric names

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -390,6 +390,9 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) {
         }
       }
       ci = CompactionInfo.optionalCompactionInfoStructToInfo(msc.findNextCompact(workerName, runtimeVersion));
+      if ((runtimeVersion != null || ci.initiatorVersion != null) && !runtimeVersion.equals(ci.initiatorVersion)) {
+        LOG.warn("Worker and Initiator versions do not match");

Review comment:
       I would include the versions in the log message




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