[ 
https://issues.apache.org/jira/browse/HIVE-26407?focusedWorklogId=799205&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-799205
 ]

ASF GitHub Bot logged work on HIVE-26407:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Aug/22 08:21
            Start Date: 09/Aug/22 08:21
    Worklog Time Spent: 10m 
      Work Description: deniskuzZ commented on code in PR #3489:
URL: https://github.com/apache/hive/pull/3489#discussion_r941042919


##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java:
##########
@@ -145,59 +145,54 @@ public void init(AtomicBoolean stop) throws Exception {
     setName(workerName);
   }
 
+  /**
+   * This doesn't throw any exceptions because we don't want the Compaction to 
appear as failed
+   * if stats gathering fails since this prevents Cleaner from doing it's job 
and if there are
+   * multiple failures, auto initiated compactions will stop which leads to 
problems that are
+   * much worse than stale stats.
+   *
+   * todo: longer term we should write something 
COMPACTION_QUEUE.CQ_META_INFO.  This is a binary
+   * field so need to figure out the msg format and how to surface it in SHOW 
COMPACTIONS, etc
+   *
+   * @param ci Information about the compaction being run
+   * @param conf The hive configuration object
+   * @param userName The user to run the statistic collection with
+   * @param compactionQueueName The name of the compaction queue
+   */
   @VisibleForTesting
-  @ThreadSafe
-  static final class StatsUpdater {
-    private static final Logger LOG = 
LoggerFactory.getLogger(StatsUpdater.class);
-
-    /**
-     * This doesn't throw any exceptions because we don't want the Compaction 
to appear as failed
-     * if stats gathering fails since this prevents Cleaner from doing it's 
job and if there are
-     * multiple failures, auto initiated compactions will stop which leads to 
problems that are
-     * much worse than stale stats.
-     *
-     * todo: longer term we should write something 
COMPACTION_QUEUE.CQ_META_INFO.  This is a binary
-     * field so need to figure out the msg format and how to surface it in 
SHOW COMPACTIONS, etc
-     *
-     * @param ci Information about the compaction being run
-     * @param conf The hive configuration object
-     * @param userName The user to run the statistic collection with
-     * @param compactionQueueName The name of the compaction queue
-     */
-    static void gatherStats(CompactionInfo ci, HiveConf conf, String userName, 
String compactionQueueName) {
-      try {
-        if (!ci.isMajorCompaction()) {
-          return;
-        }
+  protected static void gatherStats(CompactionInfo ci, HiveConf conf, String 
userName, String compactionQueueName) {

Review Comment:
   I think it would be better to extract StatsUpdater Into a standalone service.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 799205)
    Time Spent: 1.5h  (was: 1h 20m)

> Do not collect statistics if the compaction fails
> -------------------------------------------------
>
>                 Key: HIVE-26407
>                 URL: https://issues.apache.org/jira/browse/HIVE-26407
>             Project: Hive
>          Issue Type: Test
>          Components: Hive
>            Reporter: Zsolt Miskolczi
>            Assignee: Zsolt Miskolczi
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> It can still compute statistics, even if compaction fails.
> if (computeStats) \{
>   StatsUpdater.gatherStats(ci, conf, runJobAsSelf(ci.runAs) ? ci.runAs : 
> t1.getOwner(),
>           CompactorUtil.getCompactorJobQueueName(conf, ci, t1));
> }



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to