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:00:09 UTC

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

klcopp opened a new pull request #2460:
URL: https://github.com/apache/hive/pull/2460


   ### What changes were proposed in this pull request?
   If compaction was manually initiated, it shouldn't count towards the total number of hosts running the initiator
   
   
   ### How was this patch tested?
   Unit tests
   


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


[GitHub] [hive] klcopp closed pull request #2460: HIVE-25318: Number of initiator hosts metric should ignore manually initiated compactions

Posted by GitBox <gi...@apache.org>.
klcopp closed pull request #2460:
URL: https://github.com/apache/hive/pull/2460


   


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


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

Posted by GitBox <gi...@apache.org>.
asinkovits commented on a change in pull request #2460:
URL: https://github.com/apache/hive/pull/2460#discussion_r666822952



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metrics/AcidMetricService.java
##########
@@ -148,6 +150,8 @@ public static void updateMetricsFromShowCompact(ShowCompactResponse showCompactR
     }
 
     long initiatorsCount = lastElements.values().stream()
+        //manually initiated compactions don't count
+        .filter(e -> !"manual".equals(getThreadIdFromId(e.getInitiatorId())))

Review comment:
       nit: might be nicer to define a constant. 




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


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

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [hive] klcopp merged pull request #2460: HIVE-25318: Number of initiator hosts metric should ignore manually initiated compactions

Posted by GitBox <gi...@apache.org>.
klcopp merged pull request #2460:
URL: https://github.com/apache/hive/pull/2460


   


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