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/07/09 08:01:13 UTC

[GitHub] [hive] klcopp commented on a change in pull request #2460: HIVE-25318: Number of initiator hosts metric should ignore manually initiated compactions

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



##########
File path: ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCompactionMetrics.java
##########
@@ -834,19 +833,36 @@ public void testWritesToDisabledCompactionTable() throws Exception {
 
   private ShowCompactResponseElement generateElement(long id, String db, String table, String partition,
       CompactionType type, String state) {
-    return generateElement(id, db, table, partition, type, state, System.currentTimeMillis());
+    return generateElement(id, db, table, partition, type, state, false);
+  }
+
+  private ShowCompactResponseElement generateElement(long id, String db, String table, String partition,
+      CompactionType type, String state, boolean manuallyInitiatedCompaction) {
+    return generateElement(id, db, table, partition, type, state, manuallyInitiatedCompaction, System.currentTimeMillis());
   }
 
   private ShowCompactResponseElement generateElement(long id, String db, String table, String partition,
       CompactionType type, String state, long enqueueTime) {
+    return generateElement(id, db, table, partition, type, state, false, enqueueTime);
+  }
+
+  private ShowCompactResponseElement generateElement(long id, String db, String table, String partition,
+      CompactionType type, String state, boolean manuallyInitiatedCompaction, long enqueueTime) {
     ShowCompactResponseElement element = new ShowCompactResponseElement(db, table, type, state);
     element.setId(id);
     element.setPartitionname(partition);
     element.setEnqueueTime(enqueueTime);
 
-    String runtimeId = ServerUtils.hostname() + "-" + ThreadLocalRandom.current().nextInt();

Review comment:
       This was generating negative integers, that's why the number of initiator and worker hosts was 2 in testUpdateCompactionMetrics




-- 
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: gitbox-unsubscribe@hive.apache.org

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